ProcalX Posted January 7, 2010 Share Posted January 7, 2010 I know that session_start() has to be at the very top of the page and cannot have any white spaces before etc but I can't figure out why I am receiving this error: Warning: session_start() [function.session-start]: Cannot send session cache limiter - headers already sent (output started at /home/though/public_html/test/signup_form.php:1) in /home/though/public_html/test/signup_form.php on line 2 The full code for the page is: <?php session_start(); include "write_templates.php"; write_head("title here etc etc", false); ?> <?php if (isset($_SESSION['xxx'])) { echo "You are already logged in as $_SESSION[xxx], if this is not you, logout."; } else { echo "<form method='post' action='signup.php' name='input' class='style2'>"; echo "<p>"; echo "Username:<br />"; echo "<input type='text' name='username' /><br /><br />"; echo "Password:<br />"; echo "<input type='password' name='password' /><br /><br />"; echo "Name:<br />"; echo "<input type='text' name='name' /><br /><br />"; echo "Date of Birth (DD/MM/YYYY):<br />"; echo "<input type='text' name='dayofbirth' />"; echo "<input type='text' name='monthofbirth' />"; echo "<input type='text' name='yearofbirth' /><br /><br />"; echo "<input type='submit' value='Send' />"; echo "<input type='reset' value='Reset' />"; echo "</p>"; echo "</form>"; } ?> <?php write_footer(); ?> Thanks Quote Link to comment https://forums.phpfreaks.com/topic/187560-warning-session_start/ Share on other sites More sharing options...
PFMaBiSmAd Posted January 7, 2010 Share Posted January 7, 2010 If there are no actual characters before the <?php tag, then your file has been saved as a UTF-8 encoded file and the BOM (Byte Order Mark) characters that your editor placed at the start of the file are the problem. You either need to save the file as an ANSI file or if you must save it as a UTF-8 encoded file, save it without the BOM. Quote Link to comment https://forums.phpfreaks.com/topic/187560-warning-session_start/#findComment-990258 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.