php Session 传递多个值问题
...session_start();$_SESSION['uid']=$uid;$_SESSION['username']=$username;echo"<script...
...
session_start();
$_SESSION['uid'] = $uid;
$_SESSION['username'] = $username;
echo "
<script language = 'javascript'>
alert('test!');
location = 'http://localhost/test/index.php';
</script>
";
....
大概就是保存好username 和uid两个session的值后就用javascript跳转到主页,但是只有username被保存了,uid没有被保存,什么原因呢?? 展开
session_start();
$_SESSION['uid'] = $uid;
$_SESSION['username'] = $username;
echo "
<script language = 'javascript'>
alert('test!');
location = 'http://localhost/test/index.php';
</script>
";
....
大概就是保存好username 和uid两个session的值后就用javascript跳转到主页,但是只有username被保存了,uid没有被保存,什么原因呢?? 展开
展开全部
...
session_start();
session_register("uid");
$uid=$uid;
session_register("'username'");
$'username'=$'username';
echo "
<script language = 'javascript'>
alert('test!');
location = 'http://localhost/test/index.php';
</script>
";
你改成这样试试 还有啊 session_start(); 最好放在所有代买的最上面 要不容易出错
session_start();
session_register("uid");
$uid=$uid;
session_register("'username'");
$'username'=$'username';
echo "
<script language = 'javascript'>
alert('test!');
location = 'http://localhost/test/index.php';
</script>
";
你改成这样试试 还有啊 session_start(); 最好放在所有代买的最上面 要不容易出错
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询