哟?奇怪了哈~~~我把代码完全拷下来在我自己的机器上是完全正常通过了的,可以得到
s_username:guest
的结果。你的机器上的session物理文件也是发送了~~怎么会读不到了,总不能有写权限而没读权限吧~~搞笑?你试试在t2.php中直接echo $s_username ?
s_username:guest
的结果。你的机器上的session物理文件也是发送了~~怎么会读不到了,总不能有写权限而没读权限吧~~搞笑?你试试在t2.php中直接echo $s_username ?
session.save_handler = files ; handler used to store/retrieve data
session.save_path = C:\Program Files\nusphere\apache\php\tmp ; argument passed to save_handler
; in the case of files, this is the
; path where data files are stored
session.use_cookies = 1 ; whether to use cookies
session.name = PHPSESSID
; name of the session
; is used as cookie name
session.auto_start = 0 ; initialize session on request startup
session.cookie_lifetime = 0 ; lifetime in seconds of cookie
; or if 0, until browser is restarted
session.cookie_path = / ; the path the cookie is valid for
session.cookie_domain = ; the domain the cookie is valid for
session.serialize_handler = php ; handler used to serialize data
; php is the standard serializer of PHP
session.gc_probability = 1 ; percentual probability that the
; 'garbage collection' process is started
; on every session initialization
session.gc_maxlifetime = 1440 ; after this number of seconds, stored
; data will be seen as 'garbage' and
; cleaned up by the gc process
session.referer_check = ; check HTTP Referer to invalidate
; externally stored URLs containing ids
session.entropy_length = 0 ; how many bytes to read from the file
session.entropy_file = ; specified here to create the session id
; session.entropy_length = 16
; session.entropy_file = /dev/urandom
session.cache_limiter = nocache ; set to {nocache,private,public} to
; determine HTTP caching aspects
session.cache_expire = 180 ; document expires after n minutes
session.use_trans_sid = 1 ; use transient sid support if enabled
; by compiling with --enable-trans-sid
url_rewriter.tags = "a=href,area=href,frame=src,input=src,form=fakeentry"
<?
session_start();
$s_username="guest";
session_register("s_username");
Header("Location: t2.php");
?>
如何?
session的设置没错2 天酬
一样,第二次执行时才见得到值:(
作 者:abcat
所属论坛:PHP
问题点数:20
回复次数:7
发表时间:2001-11-5 15:09:33
t1.php
<?
session_start();
session_register("s_username");
$s_username="guest";
echo "注册成功,请点击<a href=t2.php>此处</a>进入t2.php";
//Header("Location: t2.php");
?> //这样是可以的,哪位给解释一下原因?如果要让它自动跳转呢?除了用header()还有啥法子? 谢谢则个,,
<!--
window.location.href="123.php";
//-->
</SCRIPT><meta http-equiv="refresh" content="0;URL=123.php">
session_register(userid);
session_register(submit1);
if ($SUBMIT=="TRUE"){
$submit1="TRUE";
$userid=$useracid;