Zephyris Posted February 18, 2011 Share Posted February 18, 2011 It's been awhile since I coded php so I'm trying to check what I'm doing wrong... session_start(); $_SESSION['utilisateur']="Invite"; if($_SESSION['utilisateur'] == "Invite") { $dlogin = file_get_contents('display_login.html'); } else { $dlogin = file_get_contents('display_usermenu.php'); } echo($dlogin); Notice: Undefined variable: _SESSION in C:\Program Files (x86)\EasyPHP-5.3.4.0\www\index.php on line 21 line 21 being if($_SESSION ... hmmm, im confused i dont see any syntax errors, do you? Quote Link to comment https://forums.phpfreaks.com/topic/228116-whats-wrong-with-my-if-s_session-statement/ Share on other sites More sharing options...
BlueSkyIS Posted February 18, 2011 Share Posted February 18, 2011 parses fine for me. Quote Link to comment https://forums.phpfreaks.com/topic/228116-whats-wrong-with-my-if-s_session-statement/#findComment-1176357 Share on other sites More sharing options...
xylex Posted February 18, 2011 Share Posted February 18, 2011 Do you have a broken custom session handler, or can the script not write to the configured session directory? If you're on PHP 5.3 or greater, var_dump on session_start() - if it's false, something's blocking the session from being created. Quote Link to comment https://forums.phpfreaks.com/topic/228116-whats-wrong-with-my-if-s_session-statement/#findComment-1176383 Share on other sites More sharing options...
Zephyris Posted February 18, 2011 Author Share Posted February 18, 2011 I uploaded it to my website and to my suprise it works... So I'm guessing my easyphp on my computer that I use to test my code is out of date or misfunctioning. Quote Link to comment https://forums.phpfreaks.com/topic/228116-whats-wrong-with-my-if-s_session-statement/#findComment-1176396 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.