第一张网页 <? session_save_path("c:\\temp"); session_start(); session_register("xu"); $xujun="quake"; ?>第二张网页 <? session_save_path("c:\\temp"); session_start(); if (session_is_registered("xu")) print "exist"; else print "no"; session_register("xu"); echo $xujun; ?>在PHP.INI里改动保存路径没有用,只能在程序里手动修改有用。但是警告还是存在。 Warning: Cannot send session cookie - headers already sent by (output started at c:\php4\test\a.php:8) in c:\php4\test\a.php on line 12Warning: Cannot send session cache limiter - headers already sent by (output started at c:\php4\test\a.php:8) in c:\php4\test\a.php on line 12而且变量没有传递到第二张网页,if 语句打印出的是"no",在TEMP目录下生成两个session文件,一个里有内容,一个为空。能不能留下你的EMAIL。如果PHP再有问题的话,我想直接发给你。等着太麻烦了。
session_is_registered("***") global $*** 用了吗? 把程序拿出来讨论吧!
我一用Session_start()都不行。出现错误如下Warning: Cannot send session cookie - headers already sent by (output started at c:\php4\test\login.php:6) in c:\php4\test\login.php on line 62Warning: Cannot send session cache limiter - headers already sent by (output started at c:\php4\test\login.php:6) in c:\php4\test\login.php on line 62
我试过建在 c:\php4\test\tmp 可是没有用。
然后设置php.ini文件中的session_save_path=c:\php\tmp就可以了,我有点记不清了是session_save_path还是什么,总之大概样子就是这样的,你在PHP.INI文件的Session中仔细找找吧!!!
<?
session_save_path("c:\\temp");
session_start();
session_register("xu");
$xujun="quake";
?>第二张网页
<?
session_save_path("c:\\temp");
session_start();
if (session_is_registered("xu")) print "exist";
else print "no";
session_register("xu");
echo $xujun;
?>在PHP.INI里改动保存路径没有用,只能在程序里手动修改有用。但是警告还是存在。
Warning: Cannot send session cookie - headers already sent by (output started at c:\php4\test\a.php:8) in c:\php4\test\a.php on line 12Warning: Cannot send session cache limiter - headers already sent by (output started at c:\php4\test\a.php:8) in c:\php4\test\a.php on line 12而且变量没有传递到第二张网页,if 语句打印出的是"no",在TEMP目录下生成两个session文件,一个里有内容,一个为空。能不能留下你的EMAIL。如果PHP再有问题的话,我想直接发给你。等着太麻烦了。
你爱用哪个就用哪个在php.ini的session.path中设置!
global $***
用了吗?
把程序拿出来讨论吧!
<?
session_start()
.
.
.?>
即用session時前面不能有輸出!
难道是微软惹得祸?
不能用PWS,IIS?天!头都痛死了!
哪里有专讲session的书?请告知!
还有,第一个<??>界定符之前有无空白或者空行。那也是不行的。
和微软没有关系。
请把<?session.....?>
放到前面、再前面.....
就是:<html>标记前!!
所有的问题都解决了!!!!!
就这么简单!