session是不是必须有页面输出才可以正确赋值??? 把php.ini中的session.auto_start改成1 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 session_start()目标页也加了阿?? 同意 dream_river(铁马兵河入梦来) session.auto_start改为1,是不是等同于所有的页面加session_start()???我把完整的代码发给大家,大家帮忙!!!!a.php<?@$q1 = $_POST['q1'];if(!empty($q1)){ $key1 = '1'; if($q1==$key1) { session_start(); $_SESSION['authorized'] = true; //header('Location: register.php'); } else { echo('<font color=red>wrong!!!</font>'); } exit;}?><html><head><title>Answer my question!</title></head><body><form method=post action='b.php'><p>who's called 'donkey'?</p><input type=radio name=q1 value=1>1<input type=radio name=q1 value=2>2<input type=radio name=q1 value=3>3<input type=radio name=q1 value=4>4<input type=radio name=q1 value=5>5</form></body></html>b.php<?if(!empty('authorized')){ header('Location: a.htm'); exit;}echo('hello,boy!!!');?>每次都跳回a.htm!!!如果你答错一次,,他就可以正确显示hello,boy!!!而且如果我将a.php的header(...)替换为:echo('<meta http-equiv="refresh" content="0;url=register.php">');运行正确!!!!为什么!!???这个问题郁闷我好几天了!!!!! 注册session变量用session_register("变量名");如:$authorized=true;session_reister("authorized");b.php<?session_start();if(!empty('authorized')){ header('Location: a.htm'); exit;}echo('hello,boy!!!');?>应该可以的. php初学者 mysql几个问题 关于php连mysql数据库的问题 关于PHP的问题 一个搜索中文问题 怎么用get 方法给一个地址传参数??请教,谢谢 php结合javascript的小问题!立即结贴 各们走过,路过,不要错过。南来的北往的进来瞧瞧了 哪里有电子商务平台的源代码 关于memcached启用sasl验证的问题 关于对文件读取的内容进行分页显示的问题。求助!! 一个有点难度的问题;怎样用PHP实现象windows的帮助文档内的索引查询功能(输入某字符后自动显示关于该字的项目)
我把完整的代码发给大家,大家帮忙!!!!a.php
<?
@$q1 = $_POST['q1'];
if(!empty($q1))
{
$key1 = '1';
if($q1==$key1)
{
session_start();
$_SESSION['authorized'] = true;
//header('Location: register.php');
}
else
{
echo('<font color=red>wrong!!!</font>');
}
exit;
}
?>
<html>
<head>
<title>Answer my question!</title>
</head>
<body>
<form method=post action='b.php'>
<p>who's called 'donkey'?</p>
<input type=radio name=q1 value=1>1
<input type=radio name=q1 value=2>2
<input type=radio name=q1 value=3>3
<input type=radio name=q1 value=4>4
<input type=radio name=q1 value=5>5
</form>
</body>
</html>b.php
<?
if(!empty('authorized'))
{
header('Location: a.htm');
exit;
}
echo('hello,boy!!!');
?>每次都跳回a.htm!!!
如果你答错一次,,他就可以正确显示hello,boy!!!
而且
如果我将a.php的header(...)替换为:
echo('<meta http-equiv="refresh" content="0;url=register.php">');
运行正确!!!!为什么!!???这个问题郁闷我好几天了!!!!!
session_register("变量名");
如:
$authorized=true;
session_reister("authorized");b.php
<?
session_start();
if(!empty('authorized'))
{
header('Location: a.htm');
exit;
}
echo('hello,boy!!!');
?>
应该可以的.