Note that there are some explanatory texts on larger screens.

plurals
  1. POProtection in my php form
    primarykey
    data
    text
    <p>I'm good with HTML, CSS and not too bad with jQuery but php I'm a total loss! Could I get some help with this Form, what is the best way to add protection into this existing php code I use on my site.</p> <p>This is the page with the tutorial for all the code <a href="http://jorenrapini.com/blog/css/jquery-validation-contact-form-with-modal-slide-in-transition" rel="nofollow">http://jorenrapini.com/blog/css/jquery-validation-contact-form-with-modal-slide-in-transition</a></p> <p>This is my site <strong>REMOVED LINK</strong></p> <p>This is the php from the tutorial used for the form that I would appreciate some assistance with adding proper protection.</p> <pre><code>&lt;?php //declare our variables $name = $_POST['name']; $email = $_POST['email']; $message = nl2br($_POST['message']); //get todays date $todayis = date("l, F j, Y, g:i a") ; //set a title for the message $subject = "Message from Your Website"; $body = "From $name, \n\n$message"; $headers = 'From: '.$email.'' . "\r\n" . 'Reply-To: '.$email.'' . "\r\n" . 'Content-type: text/html; charset=utf-8' . "\r\n" . 'X-Mailer: PHP/' . phpversion(); //put your email address here mail("youremail@domain.com", $subject, $body, $headers); ?&gt; &lt;!--Display a thankyou message in the callback --&gt; &lt;div id="mail_response"&gt; &lt;h3&gt;Thank you &lt;?php echo $name ?&gt;!&lt;/h3&gt;&lt;br /&gt; &lt;p&gt;I will answer your message soon as possible.&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt; &lt;h5&gt;Message sent on: &lt;/h5&gt; &lt;p&gt;&lt;?php echo $todayis ?&gt;&lt;/p&gt; &lt;/div&gt; </code></pre> <p>------ Okay to clarify this a bit more ------</p> <p><a href="http://codeutopia.net/blog/2008/10/16/how-to-csrf-protect-all-your-forms/" rel="nofollow">http://codeutopia.net/blog/2008/10/16/how-to-csrf-protect-all-your-forms/</a></p> <p>This is one of the many articles I've been reading over the past two weeks on Cross-Site Request Forgeries so how do you apply or add basic protection similar to this to a form like I am using</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