Note that there are some explanatory texts on larger screens.

plurals
  1. POWhat's wrong with this PHP Password form? I can't find it
    text
    copied!<p>PHP Code:</p> <pre><code>&lt;?php if (isset($_POST['pwsubmitted'])) { $pwsub=$_POST['pass']; if ($pwsub != "TEST"){ $s=1; $msg = "Incorrect Password"; $msg2 = "Try Again"; } else if ($pwsub == "TEST"){ $s=2; $msg = "Password Accepted"; $msg2 = "Your Download Is Below"; $msg3 = ""; } // so I can see what's going on when form submit happens echo "s="; var_dump($s); echo "&lt;/br&gt;"; echo "msg="; var_dump($msg); echo "&lt;/br&gt;"; echo "msg2="; var_dump($msg2); echo "&lt;/br&gt;"; echo "msg3="; var_dump($msg3); echo "&lt;/br&gt;"; } ?&gt; </code></pre> <p>Form, Placement Shown Below:</p> <pre><code>&lt;div class="passform"&gt; &lt;form id="pwform" method="post" action=""&gt; &lt;input type="hidden" name="submitted" value="pwsubmitted" /&gt; &lt;center&gt; &lt;span class="titleblue"&gt;Enter The Password&lt;/span&gt; &lt;/center&gt; &lt;input name="pass" id="pass" type="password" class="password" /&gt; &lt;input name="submit" type="submit" class="submit" style="cursor: pointer;" value="" /&gt;&lt;/div&gt; &lt;/form&gt; &lt;/div&gt; </code></pre> <p>Other Code:</p> <pre><code>&lt;?php if (isset($_POST['pwsubmitted'])) { if ($s == 1) { Do This }; if ($s == 2) { Do This }; } &lt;?php if(!isset($POST['pwsubmitted'])) { ?&gt; &lt;HTML FORM FROM ABOVE HERE&gt; &lt;?php } ?&gt; </code></pre> <p>When I submit the form... nothing happens. The original form stays up as if the pwsubmitted post variable isn't set. There's two different things that happen, either a msg saying try again, or it shows the content. Neither occur.</p> <p>What did I do wrong??</p>
 

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