salve ragazzi ho un modulo contatti con anti spam funziona ma non riesco a inserire: email inviata risponderemo il prima possibile chiedo aiuto grazie
Codice:
<?php
// if the url field is empty, but the message field isn't
if(isset($_POST['url']) && $_POST['url'] == '' && $_POST['message'] != ''){
// put your email address here
$youremail = '[email protected]';
// prepare a "pretty" version of the message
// Important: if you added any form fields to the HTML, you will need to add them here also
$body = "This is the form that was just submitted:
Name: $_POST[name]
E-Mail: $_POST[email]
Message: $_POST[message]";
// Use the submitters email if they supplied one
// (and it isn't trying to hack your form).
// Otherwise send from your email address.
if( $_POST['email'] && !preg_match( "/[\r\n]/", $_POST['email']) ) {
$headers = "From: $_POST[email]";
} else {
$headers = "From: $youremail";
}
// finally, send the message
mail($youremail, 'Contact Form', $body, $headers );
}
?>
<div class="col-lg-6 offset-lg-3">
<form method="post" action="contatti.php">
<p>Nome e cognome:
<br /><input name="name" /></p>
<p>Tua email:
<br /><input name="email" /></p>
<!-- Important: if you add any fields to this page, you will also need to update the php script -->
<p class="antispam">Lascia questo campo vuoto:
<br /><input name="url" /></p>
<p>Scrivi messaggio:
<br /><textarea name="message" rows="10" cols="50"></textarea></p>
<p><input type="submit" value="Send" /></p>
</form>