a.php文件如下:
b.php文件如下:
//检查 php的版本,php4.1前面 get post的表示法为$HTTP_GET_VARS和$HTTP_POST_VARS,为了向后兼容,统一成$_GET , $_POST
if(PHP_VERSION < '4.1.0')
{
$_GET = &$HTTP_GET_VARS;
$_POST = &$HTTP_POST_VARS;
$_COOKIE = &$HTTP_COOKIE_VARS;
$_SERVER = &$HTTP_SERVER_VARS;
$_ENV = &$HTTP_ENV_VARS;
$_FILES = &$HTTP_POST_FILES;
//废除变量
unset($_ENV,$HTTP_ENV_VARS,$_REQUEST,$HTTP_POST_VARS,$HTTP_GET_VARS,$HTTP_POST_FILES,$HTTP_COOKIE_VARS,$_FILES);
}
//如果php版本高于 4.1,直接执行下面 的
$name = $_POST['name'];
echo $name ;
?>