换win7了,装的是phpnow最新的包PHPnow-1.5.5_1版本
apache是2.0版本但是这句php运行出错,我是在本机环境下测试
if($_COOKIE['Yahei20100331']!=null)
header("Location:admin_index.php");提示:
Notice: Undefined index: Yahei20100331 in E:\Web\htdocs\index.php on line 3
这个程序我以前在老机器上测试是没有问题
而且放在购买的美国主机和香港主机上运行也都是正常的。
奇怪了
apache是2.0版本但是这句php运行出错,我是在本机环境下测试
if($_COOKIE['Yahei20100331']!=null)
header("Location:admin_index.php");提示:
Notice: Undefined index: Yahei20100331 in E:\Web\htdocs\index.php on line 3
这个程序我以前在老机器上测试是没有问题
而且放在购买的美国主机和香港主机上运行也都是正常的。
奇怪了
应该没拼错吧.
或者在程序中加上
error_reporting(E_ALL ^ E_NOTICE);
PHP4的时候,这类notice是不显示的。
你print_r($_COOKIE);一下看看有没有这个:Yahei20100331
没有,就会报notice。
可以在php.ini里屏蔽notice,或者用如下代码:
$name=isset($_COOKIE["Yahei20100331"])?$_COOKIE["Yahei20100331"]:"";
if($name!="") header("Location:admin_index.php");