|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2006-04-14 09:42 UTC] tony2001@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2026 The PHP GroupAll rights reserved. |
Last updated: Wed Oct 07 17:00:02 2026 UTC |
Description: ------------ I just test file login.php but when I submit it show errors session_start(): Cannot send session cookie and cannot modify header information - headers already sent by ... I don't use echo or print anything before Reproduce code: --------------- <body> <? $login = $_POST["login"]; if ($login==1) { session_start(); $admin = "abc"; session_register("admin"); header("Location: admin.php"); } ?> <form name="frmLogWP_User" method="post" action="login.php"> <input type="submit"> <input type=hidden name="login" value="1"> </form> </body> Expected result: ---------------- Warning: session_start(): Cannot send session cookie - headers already sent by (output started at /home2/glass/avsstouristservices-www/tiepthivn/wcms/aaa.php:8) in /home2/glass/avsstouristservices-www/tiepthivn/wcms/aaa.php on line 11 Warning: session_start(): Cannot send session cache limiter - headers already sent (output started at /home2/glass/avsstouristservices-www/tiepthivn/wcms/aaa.php:8) in /home2/glass/avsstouristservices-www/tiepthivn/wcms/aaa.php on line 11 Warning: Cannot modify header information - headers already sent by (output started at /home2/glass/avsstouristservices-www/tiepthivn/wcms/aaa.php:8) in /home2/glass/avsstouristservices-www/tiepthivn/wcms/aaa.php on line 14