Note that there are some explanatory texts on larger screens.

plurals
  1. POContact page redirect issue
    text
    copied!<p>For some reason my contact page won't relocate to thanks.html. It just stays at the contact page and the contact form disappears. </p> <pre><code>&lt;?php if (empty($_POST) === false) { $errors = array(); $name = $_POST['name']; $email = $_POST['email']; $message = $_POST['message']; if (empty($name) === true || empty($email) === true || empty($message) === true) { $errors[] = 'Name, email, and message are required.'; } else { if (filter_var($email, FILTER_VALIDATE_EMAIL) === false) { $errors[] = 'Please enter a valad email address.'; } } if (empty($errors) === true) { mail('joe@mydomain.com', 'Contact Form' ,'$message', 'From: ' . $email); header('Location: thanks.html'); exit(); } } ?&gt; </code></pre> <p>Here is my code from the form as well.</p> <pre><code>&lt;?php if (empty($errors) === false) { echo '&lt;ul&gt;'; foreach($errors as $error) { echo '&lt;li&gt;', $error, '&lt;/li&gt;'; } echo '&lt;ul&gt;'; } ?&gt; &lt;/div&gt; &lt;div id="content"&gt; &lt;form action="" method="post"&gt; &lt;p&gt; &lt;label for="name"&gt;Name:&lt;/label&gt;&lt;br /&gt; &lt;input type="text" name="name" id="name" &lt;?php if (isset($_POST['name']) === true) { echo 'value="', strip_tags($_POST['name']), '"'; } ?&gt; /&gt; &lt;/p&gt; &lt;p&gt; &lt;label for="email"&gt;Email:&lt;/label&gt;&lt;br /&gt; &lt;input type="text" name="email" id="email" &lt;?php if (isset($_POST['email']) === true) { echo 'value="', strip_tags($_POST['email']), '"'; } ?&gt;/&gt; &lt;/p&gt; &lt;p&gt; &lt;label for="message"&gt;Message:&lt;/label&gt;&lt;br /&gt; &lt;textarea name="message" id="message"&gt;&lt;?php if (isset($_POST['message']) === true) { echo strip_tags($_POST['message']), ''; } ?&gt;&lt;/textarea&gt; &lt;/p&gt; &lt;p&gt; &lt;input type="submit" /&gt; &lt;/p&gt; &lt;/form&gt; &lt;/div&gt; </code></pre> <p>Anyone have a quick fix for this? It's driving me crazy. I've been trying different variations of these lines in the code above but nothing is working...</p> <pre><code>if (empty($errors) === true) { mail('joe@mydomain.com', 'Contact Form' ,'$message', 'From: ' . $email); header('Location: thanks.html'); exit(); </code></pre>
 

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