Note that there are some explanatory texts on larger screens.

plurals
  1. POWhy are my form variables not passing through POST?
    primarykey
    data
    text
    <p>I am sending form data through POST, but the corresponding POST variables are not set, and do not.</p> <p>Also, when I store POST data into local PHP variables, I seem to be unable to use those variables. (Once I resolve the first issue, I have a feeling I will be able to user the variables too.)</p> <p>My error messages output by the second page (see below) is:</p> <pre><code>Notice: Undefined variable: postUsername in (...somepath)\scripts\create-member.php on line 10 </code></pre> <p>(Form page) :</p> <pre><code>&lt;form action="scripts/create-member.php" method="POST"&gt; &lt;input type="text" name"username" value="" placeholder="User Name"&gt; &lt;br /&gt; &lt;input type="password" name"password" value="" placeholder="Password"&gt; &lt;br /&gt; &lt;input type="password" name"passwordConfirm" value="" placeholder="Confirm Password"&gt; &lt;br /&gt; &lt;!-- ?type email or type text --&gt; &lt;input type="email" name"email" value="" placeholder="Email" autofocus&gt; &lt;br /&gt; &lt;input type="submit" name="submitRegistration" value="Register!"&gt; &lt;/form&gt; </code></pre> <p>(Second page) scripts\create-member.php:</p> <pre><code>&lt;?php //!proper way to declare variables obtained from POST. // Data from form "register.php" if ( isset($_POST['username']) ) { $postUsername = $_POST['username']; } echo $postUsername; // &lt;-- this is line 10 </code></pre> <p>?></p> <p>I've tried using isset() for the submit button too, but that didn't solve the problem. I've simplified the code by a lot here, and ran it testing it too.</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.
    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