现在的位置: 首页 > php学习 > 正文

Your script possibly relies on a session side-effect which existed until PHP 4.2.3. Please be advise

2014年11月13日 php学习 ⁄ 共 750字 ⁄ 字号 暂无评论 ⁄ 阅读 1,691 次

Warning: Unknown: Your script possibly relies on a session side-effect which existed until PHP 4.2.3. Please be advised that the session extension does not consider global variables as a source of data, unless register_globals is enabled. You can disable this functionality and this warning by setting session.bug_compat_42 or session.bug_compat_warn to off, respectively in Unknown on line 0

错误代码实例:

<?php
include(dirname(__FILE__).'/init.php');
session_start();
//显示当前登陆用户

// 参数为out,注销
/*      if($_GET['log'] == "out"){
//setcookie("username","",time()-1,"/");
//setcookie("userid","",time()-1,"/");
unset($_SESSION["username"]);
unset($_SESSION["userid"]);
$_GET['log'] =null;

}
*/
  $userid=$_SESSION['userid'];
  $name=$_SESSION['username'];

$good_id =$_GET['id'];
var_dump($good_id);
?>

解决方法:原因是删除session或者未设置session时使用了session.

猜你喜欢

给我留言

留言无头像?