Forum Moderators: coopster
Name
E-Mail
Message
when the user press the button the message is sent I was wondering can somehow make me a script that will check all three text boxes for data before send it along with the IP address of the sender and place cookie onto the machine that prevents the user from bombarding me with mail so lets say maximum 2 message every 60mins
Also I was wondering if I can add a new text called subject that be the subject so when I receive an e-mail it will display the e-mail address as who it is from and the subject as the subject line thank you
When they submit it will say thank you and your message received otherwise it will says sorry not sent and if they bombring me it will says you are only allowed 2 sent 2 message every 60 mins
<?php
if (empty($_POST['name']) or empty($_POST['thereemail']) or empty($_POST['message']))
{
exit("You have not filled in all the required fields!");
}
if($_COOKIE['sentemail'] == "2"){
include("includes/sorry.template.php");
}
else{
$num = $sentmessage + 1;
$email = "Sender Name:\t".$_POST['name']."\nSender E- Mail:\t".$_POST['thereemail']."\nMessage:\t".$_POST['message']."\nIP:\t".$_SERVER['REMOTE_ADDR']."\n\n";
$to = "xx@xxx.com";
$subject = "Website Message";
$mailheaders = "From: ".$_POST['thereemail']." <".$_POST['thereemail']."> \n";
$mailheaders .= "Reply-To: ".$_POST['thereemail']."\n\n";
mail($to, $subject, $email, $mailheaders);
include("includes/thanksecho.template.php");
}
?>
How can i place a Reset button to clear all fields?