Matthew Herren Posted September 26, 2009 Share Posted September 26, 2009 Ok i'm trying to make a two page form. My first problem is that i'm trying to store the information from page one in <?php session_start(); session_register('name'); session_register('email_address'); $_SESSION['name'] = $_POST['name']; $_SESSION['email_address'] = $_POST['email_address']; ?> then i have my form. <form method="post" action="submit.php"> <input type="radio" group="membership_type" value="Free"> <input type="radio" group="membership_type" value="Normal"> <input type="radio" group="membership_type" value="Deluxe"> <input type="checkbox" name="terms_and_conditions"> <input type="submit" value="Submit"> </form> But i keep getting the error message Warning: session_start() [function.session-start]: Cannot send session cookie - headers already sent by (output started at/auto/form2.php:2) Link to comment https://forums.phpfreaks.com/topic/175622-solved-functionsession-start/ Share on other sites More sharing options...
mikesta707 Posted September 26, 2009 Share Posted September 26, 2009 if you are including the first page, or for any reason session_start() isn't at the very top of the page, then move it to the very top of the page Link to comment https://forums.phpfreaks.com/topic/175622-solved-functionsession-start/#findComment-925422 Share on other sites More sharing options...
Matthew Herren Posted September 26, 2009 Author Share Posted September 26, 2009 It is at the top of the page. Link to comment https://forums.phpfreaks.com/topic/175622-solved-functionsession-start/#findComment-925424 Share on other sites More sharing options...
PFMaBiSmAd Posted September 26, 2009 Share Posted September 26, 2009 The error message indicates that there are probably two blank lines before the opening <?php tag. Link to comment https://forums.phpfreaks.com/topic/175622-solved-functionsession-start/#findComment-925434 Share on other sites More sharing options...
Matthew Herren Posted September 26, 2009 Author Share Posted September 26, 2009 OK i deleated the blank lines and that solved it. facewall: Link to comment https://forums.phpfreaks.com/topic/175622-solved-functionsession-start/#findComment-925436 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.