Note that there are some explanatory texts on larger screens.

plurals
  1. POPHP Code suddenly stopped working
    primarykey
    data
    text
    <blockquote> <p><strong>Possible Duplicate:</strong><br> <a href="https://stackoverflow.com/questions/4261133/php-notice-undefined-variable-and-notice-undefined-index">PHP: “Notice: Undefined variable” and “Notice: Undefined index”</a> </p> </blockquote> <p>Had code that was working fine. Had to reboot the server and now it doesn't work.</p> <p>I have this at the start of the "landing" page (this is the page users get to after their password is validated)</p> <pre><code>&lt;?PHP session_start(); ?&gt; &lt;html&gt;&lt;head&gt; &lt;title&gt;Welcome&lt;/title&gt; &lt;/head&gt;&lt;body&gt; &lt;?PHP $_SESSION['valid']='TRUE'; ?&gt; ... code and HTML ... &lt;/body&gt;&lt;/html&gt; </code></pre> <p>When I do a print_r I get </p> <pre><code>"Array([valid] =&gt; TRUE)" </code></pre> <p>On all my subsequent pages I have </p> <pre><code>&lt;?PHP session_start(); ?&gt; &lt;html&gt; &lt;head&gt;&lt;title&gt;Page Title&lt;/title&gt; &lt;/head&gt; &lt;body&gt; &lt;?php /// Kick them out if they try to open this page directly if ($_SESSION['valid']!='TRUE') { session_destroy(); die("&lt;b&gt;You must be logged into this application to use it&lt;/b&gt;"); ?&gt; ... code and html ... &lt;/body&gt;&lt;/html&gt; </code></pre> <p>This was working fine before, but now I get:</p> <p>Notice: Undefined index: valid in C:\inetpub\wwwroot\usermanager\selectuser.php on line 9</p> <p>You must be logged into this application to use it.</p> <p>When I put a debugging statement in with print_r I just get "Array()" for the value of $_SESSION.</p> <p>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 <em>was</em> working.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload