我用session_register("user");后出错: Warning: Cannot send session cookie - headers already sent by (output started at E:\Soft Project\PHP\MySQLTest.php:6) in E:\Soft Project\PHP\MySQLTest.php on line 7Warning: Cannot send session cache limiter - headers already sent (output started at E:\Soft Project\PHP\MySQLTest.php:6) in E:\Soft Project\PHP\MySQLTest.php on line 7为什么?????
Warning: Cannot send session cookie - headers already sent by (output started at E:\Soft Project\PHP\MySQLTest.php:6) in E:\Soft Project\PHP\MySQLTest.php on line 7headers already sent 是说头文件已经发送了吧在使用 session 的之前不能输出任何内容,一个空格一个回车都不成可惜答这个没分 ToT
登陆=失败; if (通过了验证){ //比如:"select id form user where username='aaa' and password='bbb'"返回true 登陆=成功; } if (登陆==成功){ echo "同志,终于等到你了"; echo "以下省略党的机密若干,当然只有革命同志才能见到"; } else { echo "你丫哪个单位的,小孩子不要乱跑啊,不然你妈妈会找不到你的"; exit(); }
Warning: Cannot send session cookie - headers already sent by (output started at E:\Soft Project\PHP\MySQLTest.php:6) in E:\Soft Project\PHP\MySQLTest.php on line 7Warning: Cannot send session cache limiter - headers already sent (output started at E:\Soft Project\PHP\MySQLTest.php:6) in E:\Soft Project\PHP\MySQLTest.php on line 7为什么?????
到http://www.csdn.net/expert/topic/495/495291.shtm
if (通过了验证){
//比如:"select id form user where username='aaa' and password='bbb'"返回true
登陆=成功;
}
if (登陆==成功){
echo "同志,终于等到你了";
echo "以下省略党的机密若干,当然只有革命同志才能见到";
}
else {
echo "你丫哪个单位的,小孩子不要乱跑啊,不然你妈妈会找不到你的";
exit();
}