NerdConcepts Posted March 14, 2007 Share Posted March 14, 2007 I have no idea what is going on now. When someone enters the site it gives them a session...ok so what. Well when a business wants to edit their business info they can login. When they login it gives the a $_SESSION['edit_mode'] = 'FALSE'; When they want to actually edit their information they can enter "edit mode" which then changes the $_SESSION['edit_mode'] = 'TRUE'; yet when I try to change 'edit_mode' from false to true I get... A session had already been started - ignoring session_start() There is NO code anywhere on the page that changes the 'edit_mode' value that starts a session. I don't understand why this is being such a pain in the butt. Here is all the code I am using. if (isset($_GET['mode'])) { if ($_GET['mode'] == 'TRUE') { $_SESSION['edit_mode'] = 'TRUE'; } if ($_GET['mode'] == 'FALSE') { $_SESSION['edit_mode'] = 'FALSE'; } } Basically the link to enter edit mode is index.php?mode=TRUE and to leave edit mode it is index.php?mode=FALSE. Only a business that logs in will see these links. I have actually tried a few ways to do this. Even created 2 different pages. 1 to set the value to TRUE and 1 to set the value to FALSE...but they all don't work. When they were on separate pages, once the session value for 'edit_mode' was changed from FALSE to TRUE it would then redirect to the main page, but then there it would still show that the session value for 'edit_mode' was still FALSE when it has been changed to TRUE.... Link to comment https://forums.phpfreaks.com/topic/42595-solved-stupid-session-edit-problem/ Share on other sites More sharing options...
trq Posted March 14, 2007 Share Posted March 14, 2007 Where is your call to session_start()? You need that on ALL pages using the $_SESSION array. Also, booleens (TRUE, FALSE) are not strings and should NOT be surrounded in quotes. Link to comment https://forums.phpfreaks.com/topic/42595-solved-stupid-session-edit-problem/#findComment-206707 Share on other sites More sharing options...
NerdConcepts Posted March 14, 2007 Author Share Posted March 14, 2007 I know all about session, lol. session_start(); is displayed within the header and that is called to on all pages, so I know that isn't the problem. The problem was simple. I changed from using TRUE and FALSE and moved to using 0 and 1. Not sure how that changed anything, but it's all fixed. Thanks a bunch Link to comment https://forums.phpfreaks.com/topic/42595-solved-stupid-session-edit-problem/#findComment-206774 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.