Hello
I have shtml page which is feedback page, i have done most it with html form tags and using java script.
however i want to process the form i.e. send the data to an email address in the form tag.
here ->
<FORM ACTION=”form_process.php” METHOD=”POST” ENCTYPE=”application/x-www-form-urlencoded” NAME=”test” ID=”ENQUIRY”>
so if i made a php script like the one below and alled it form_process.php will this work?
<?
$sendform = false;
if(isset($_POST[‘Submit’])){
while(list($key,$val) = each($
$$key = $val;
if($val!=”) $sendform = true;
}
if((!eregi(“^[_..
echo “<span class=”newstime”>Invalid email address and message can’t be empty!</span>”;
}
else if($sendform==true) {
$headers = “From: “.$name.”<“.$email.”>nReply-To: “.$email;
$recipientName = “Admin”;
$recipient = “
$message =”From : $namen”;
$message .=”Phone : $phonen”;
$message .=”Comment : $msgn”;
$subjectPrefix = ” Website Enquiry”;
$headersResp = “From: “.$recipientName.”<“.$recipient.”>nReply-
$issent = mail($recipient, $subject, $message, $headers);
if(isset($issent)) echo “<span class=”newstime”>Thank you for your message!</span>”;
} else echo “<span class=”newstime”>All fields must be filled in. Unable to send form.</span>”;
}
?>
thanks your advice people much appreciated.