Possible Duplicate:
PHP: “Notice: Undefined variable” and “Notice: Undefined index”
Had code that was working fine. Had to reboot the server and now it doesn't work.
I have this at the start of the "landing" page (this is the page users get to after their password is validated)
<?PHP session_start(); ?>
<html><head>
<title>Welcome</title>
</head><body>
<?PHP $_SESSION['valid']='TRUE'; ?>
... code and HTML ...
</body></html>
When I do a print_r I get
"Array([valid] => TRUE)"
On all my subsequent pages I have
<?PHP session_start(); ?>
<html>
<head><title>Page Title</title>
</head>
<body>
<?php
/// Kick them out if they try to open this page directly
if ($_SESSION['valid']!='TRUE') {
session_destroy();
die("<b>You must be logged into this application to use it</b>");
?>
... code and html ...
</body></html>
This was working fine before, but now I get:
Notice: Undefined index: valid in C:\inetpub\wwwroot\usermanager\selectuser.php on line 9
You must be logged into this application to use it.
When I put a debugging statement in with print_r I just get "Array()" for the value of $_SESSION.
Why isn't it working anymore?!? I've been tearing my hair out for four hours now trying to figure this out. NOTHING has changed in the code and it was working.