Note that there are some explanatory texts on larger screens.

plurals
  1. POForm going to 404 page when name input has a value
    primarykey
    data
    text
    <p>I am completely stumped with this (that, or I've just been staring at it for too long that there is an obvious error and I can't see it)</p> <p>I've got a simple form which validates on the same page which is a custom template I have made</p> <pre><code>&lt;form action="" method="post"&gt; &lt;input type="text" id="name" name="name" placeholder="Please enter your full name" /&gt; &lt;input type="email" id="email" name="email" placeholder="Please enter your email address" /&gt; &lt;input type="hidden" name="newsletterform" value="newsletterform" /&gt; &lt;input class="submit" type="submit" name="submit" id="searchsubmit" value="submit" /&gt; &lt;/form&gt; </code></pre> <p>It is then validated like so</p> <pre><code>&lt;?php $formsubmitted = (!empty($_POST['newsletterform'])) ? $_POST['newsletterform'] : ""; if($formsubmitted !== ''){ $fullname = (!empty($_POST['name'])) ? $_POST['name'] : ""; $email = (!empty($_POST['email'])) ? $_POST['email'] : ""; $failed = ''; if (empty($fullname)){ $failed.= 'Please enter your name.&lt;br /&gt;'; } if (empty($email)){ $failed.= 'Please enter your email address.&lt;br /&gt;'; } } if ($failed == '' and $formsubmitted !== ''){ ?&gt; &lt;div id="success-title"&gt; Thank you for signing up! &lt;/div&gt; &lt;?php } if ($failed !== '' and $formsubmitted !== '') { ?&gt; &lt;div id="error-title"&gt; Sorry, we could not accept the details you submitted to us. Please see below. &lt;/div&gt; &lt;div id="error-body"&gt; &lt;?php echo $failed;?&gt; &lt;/div&gt; &lt;?php } ?&gt; </code></pre> <p>It shows the errors when you try to send an empty form, it validates the email fine when there is a value in there and when the name field is empty. When something is entered into the name field when there is something or nothing in the email field it goes to my 404 page.</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