PHPwind 4.3.2 require/defend.php 5-10行
来源:互联网 发布:股票数据接口 编辑:程序博客网 时间:2024/06/06 07:36
foreach($_POST as $_key=>$_value){
!ereg("^/_",$_key) && !isset($$_key) && $$_key=$_POST[$_key];
}
foreach($_GET as $_key=>$_value){
!ereg("^/_",$_key) && !isset($$_key) && $$_key=$_GET[$_key];
}
相当启用PHP.INI中的register_globals选项,
比如URL是:http://www.thisky.com/index.php?n=123
如果PHP.INI中的register_globals选项是启用的,则echo $n;就会输出123
如果是关闭的则输出空,要echo $_GET[n];才会输出123
而在程序开头加上上面一段代码,就算register_globals选项是关闭的,echo $n;仍然会输出123
补充:这样写好像不怎么好吧,直接
extract($_POST);
extract($_GET);
不就可以了
再补充:又看到一个函数,更简单了:
import_request_variables('pg');
一句就解决。
我这样子不是更好?
http://hi.baidu.com/0x23/blog/item/33c27558eb999ad69d820441.html
- PHPwind 4.3.2 require/defend.php 5-10行
- phpwind global.php 注释
- PHP学习(5)-include 、require
- php require
- phpwind源码解析------index.php
- phpwind V7.5
- phpwind图文安装2
- php论坛phpwind和discuz比较
- PHP require 绝对路径 autoload
- php include VS require
- php:include&require
- php require include
- php--include and require
- PHP ----Include,require
- php require vs. include
- 53. PHP require
- PHP-include和require
- PHP include和require
- 成龙为什么不憎恨
- [.NET] 用C#取得列表机的相关资讯
- C#异步操作(转载推荐)
- PHPWind4.32 自定义积分说明【credit.php】
- j2se中的新特性 import static
- PHPwind 4.3.2 require/defend.php 5-10行
- 程序员的爱情之数字表白
- Linux下Java服务启动脚本
- (三)生活在这里 也在别处
- Flex组件: Alert的使用方式
- Groovy入门教程
- error linux connection to mysql server on 10065
- ZJUT1478-挽救损失 //MAXMATCH
- 清除日志