Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>The lines:</p> <pre><code>$cf_name = Trim(stripslashes($_POST['Name'])); $cf_email = Trim(stripslashes($_POST['Email'])); $cf_message = Trim(stripslashes($_POST['Message'])); </code></pre> <p>should be changed to</p> <pre><code>$cf_name = Trim(stripslashes($_POST['cf_name'])); $cf_email = Trim(stripslashes($_POST['cf_email'])); $cf_message = Trim(stripslashes($_POST['cf_message'])); </code></pre> <p>The variable name doesn't matter, but the text inside <code>$_POST['']</code> <strong>should be the same as the name value for the form element!</strong> You prefixed the names in your HTML with <code>cf_</code>, but didn't do the same in your PHP!</p> <p><strong>EDIT:</strong> Oops, I missed something! You are linking to <code>contactengine.php</code> with an <code>&lt;a&gt;</code> link! Your browser treats this as a regular <code>GET</code> request, <strong>and doesn't send the data with it!</strong> Even though you put JavaScript code to submit the form, <strong>the browser's default action (to go to the link) overpowers your code</strong>.</p> <p>To fix this, either </p> <ol> <li>Change the last <code>&lt;a&gt;</code> tag in <code>contacts.html</code> to <code>&lt;input type="submit" value="Submit" /&gt;</code>, turning the link into a submit button, <em>or</em></li> <li>Add <code>; return false;</code> to the end of your <code>onclick</code> handler for the submitting link. This stops the browser from doing its default behavior, and submits the form.</li> </ol>
 

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