I use the following mail command to receive form data in my inbox:
<?php
$msg .= "Name:\t\t$_POST[name]\n";
$msg .= "E-Mail:\t$_POST\n";
$msg .= "Company:\t$_POST[company]\n";
$msg .= "Telephone:\t$_POST[telephone]\n";
$msg .= "Address:\t$_POST[address]\n";
$msg .= "Comments:\t$_POST[comments]\n";
$recipient = "me@myaddress.co.uk";
$subject = "Contact Form";
$mailheaders = "From: My Web Site <> \n";
$mailheaders .= "Reply To: $_POST[email]\n\n";
mail($recipient, $subject, $msg, $mailheaders);
echo "<HTML><HEAD><TITLE>Form Sent!</TITLE></HEAD><BODY>";
echo "<H1 align=center>Thank You, $_POST[name]</H1>";
echo "<P align=center>We will contact you shortly</P>";
echo "</BODY></HTML>";
?>
Can anyone tell me how I make the name and e-mail fields, required fields?
Thanks in advance for your help
<?php
$msg .= "Name:\t\t$_POST[name]\n";
$msg .= "E-Mail:\t$_POST\n";
$msg .= "Company:\t$_POST[company]\n";
$msg .= "Telephone:\t$_POST[telephone]\n";
$msg .= "Address:\t$_POST[address]\n";
$msg .= "Comments:\t$_POST[comments]\n";
$recipient = "me@myaddress.co.uk";
$subject = "Contact Form";
$mailheaders = "From: My Web Site <> \n";
$mailheaders .= "Reply To: $_POST[email]\n\n";
mail($recipient, $subject, $msg, $mailheaders);
echo "<HTML><HEAD><TITLE>Form Sent!</TITLE></HEAD><BODY>";
echo "<H1 align=center>Thank You, $_POST[name]</H1>";
echo "<P align=center>We will contact you shortly</P>";
echo "</BODY></HTML>";
?>
Can anyone tell me how I make the name and e-mail fields, required fields?
Thanks in advance for your help