jquery - Protection in my php form -


i'm html, css , not bad jquery php i'm total loss! form, best way add protection existing php code use on site.

this page tutorial code http://jorenrapini.com/blog/css/jquery-validation-contact-form-with-modal-slide-in-transition

this site removed link

this php tutorial used form appreciate assistance adding proper protection.

<?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 title message $subject = "message 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 email address here mail("youremail@domain.com", $subject, $body, $headers); ?> <!--display thankyou message in callback --> <div id="mail_response">     <h3>thank <?php echo $name ?>!</h3><br />     <p>i answer message possible.</p><br /><br /><br />     <h5>message sent on: </h5>     <p><?php echo $todayis ?></p> </div>  

------ okay clarify bit more ------

http://codeutopia.net/blog/2008/10/16/how-to-csrf-protect-all-your-forms/

this 1 of many articles i've been reading on past 2 weeks on cross-site request forgeries how apply or add basic protection similar form using

mail("youremail@domain.com", $subject, $body, $headers);  

can send mail, obviously, need create message check if mail function not successful.

so,

if(mail("youremail@domain.com", $subject, $body, $headers)){   echo 'your email sent'; }else{   echo 'email not sent'; } 

the above code, guarantee, if there problem mail() user see costume-built message actual error exposing code , directory


Comments

Popular posts from this blog

Perl - how to grep a block of text from a file -

delphi - How to remove all the grips on a coolbar if I have several coolbands? -

javascript - Animating array of divs; only the final element is modified -