新闻中心 | 电脑硬件 | 手机 | 数码相机 | 笔记本频道 | 服务器 | 美图频道 「总」 生活频道 渔鱼频道 电影频道 游戏频道 旅游频道 设为首页 | 收藏
网络学院
迷城学吧
硬件
手机
旅游
生活
渔鱼
美图
电影
游戏
  导航: 迷城学吧 · 网站编程教程 · PHP教程 · PHP数据库  

php 用户提交数据

图文推荐
『php 用户提交数据』可能有大量图片,显示会较慢,请等待图片下载完成
 
点击数: 更新时间:2007-8-23 0:11:44 

用户提交的数据

The greatest weakness in many PHP programs is not inherent in the language itself, but merely an issue of code not being written with security in mind. For this reason, you should always take the time to consider the implications of a given piece of code, to ascertain the possible damage if an unexpected variable is submitted to it.

例子 15-17. 危险的变量用法

<?php
// remove a file from the user's home directory... or maybe
// somebody else's?
unlink ($evil_var
);

// Write logging of their Access... or maybe an /etc/passwd entry?
fputs ($fp, $evil_var
);

// Execute something trivial.. or rm -rf *?
system ($evil_var
);
exec ($evil_var
);

?>
You should always carefully examine your code to make sure that any variables being submitted from a web browser are being properly checked, and ask yourself the following questions:

  • Will this script only affect the intended files?

  • Can unusual or undesirable data be acted upon?

  • Can this script be used in unintended ways?

  • Can this be used in conjunction with other scripts in a negative manner?

  • Will any transactions be adequately logged?

By adequately asking these questions while writing the script, rather than later, you prevent an unfortunate re-write when you need to increase your security. By starting out with this mindset, you won't guarantee the security of your system, but you can help improve it.

You may also want to consider turning off register_globals, magic_quotes, or other convenience settings which may confuse you as to the validity, source, or value of a given variable. Working with PHP in error_reporting(E_ALL) mode can also help warn you about variables being used before they are checked or initialized (so you can prevent unusual data from being operated upon).

】【关闭窗口
  ·上一篇:
  ·下一篇: 没有了
PHP数据库:相关文章
PHP数据库点击榜
普通教程php 用户提交数据
普通教程php Using Register Globals
普通教程php错误报告
普通教程php数据库安全
推荐教程IIS+PHP+MySQL+Zend Optimizer+
推荐教程apache+mysql+php+ssl服务器之完
推荐教程Win2003下APACHE+PHP5+MYSQL4+P
推荐教程在Win2000ADV下配置Apache+PHP5
推荐教程PHP+MySQL分页显示示例说明
推荐教程PHP+Oracle(OCI) 初步
网友自拍|生活百味|历史图片|摄影世界|明星图片|体坛图库|美女图片|图片纪实|世界奇观
电脑硬件推荐文章
advertisement
关于站点 - 广告服务 - 联系我们 - 版权隐私 - 免责声明 - 合作伙伴 - 程序支持 - 网站地图 - 库库中文网 | 设为首页 | 本页加入收藏 返回顶部
网站文本地图
版权所有:迷城学吧 欢迎各种媒体转载我们的原创作品[转载请注明出处]
Copyright © 2005-2008 www.McXb.com online services. all rights reserved. 蜀ICP备09003996
Template designed by Monsi. Optimized for 1024x768 to Firefox and MS-IE6 7. Site powered by JoyON.
红盾Gov315
有一个迷样的城市
在每个人的内心深处
让我们探索发掘这古老的墓