icomedsupply
New Member
- Messages
- 7
- Reaction score
- 0
- Points
- 0
hey I've been searching on google and I can't seem to find the code that you put in a phpform that makes the form check if the email is real/require that certain parts of the form be filled out other wise it won't submit.
here is the code:
here is the code:
Code:
<?php
if (isset($_REQUEST['submit'])) {
$fname = $_POST['fname'];
$lname = $_POST['lname'];
$faddress = $_POST['faddress'];
$laddress = $_POST['laddress'];
$state = $_POST['state'];
$country = $_POST['country'];
$city = $_POST['city'];
$zip = $_POST['zip'];
$phone = $_POST['phone'];
$fax = $_POST['fax'];
$email = $_POST['email'];
$mobile = $_POST['mobile'];
$best_time = $_POST['best_time'];
$preferred = $_POST['preferred'];
$comments = $_POST['comments'];
echo <<<thanks
<font face="Arial" size="3">
Thank you for your comments! <br><br>
We will get back to you as soon as possible
<br><br>
</font>
thanks;
$datetime = date("YmdHis");
$mess = "<table border='0' width='500' bgcolor='#C0C0C0' cellspacing='1'>
<tr>
<td bgcolor='#FFFFFF' align='center'><font face='Arial' size='2'><b>First Name</b></font></td>
<td bgcolor='#FFFFFF'><font face='Arial' size='2'>" . $fname . "</font></td>
</tr>
<tr>
<td bgcolor='#FFFFFF' align='center'><font face='Arial' size='2'><b>Last Name</b></font></td>
<td bgcolor='#FFFFFF'><font face='Arial' size='2'>" . $lname . "</font></td>
</tr>
<tr>
<td bgcolor='#FFFFFF' align='center'><font face='Arial' size='2'><b>Address</b></font></td>
<td bgcolor='#FFFFFF'><font face='Arial' size='2'>" . $faddress . "</font></td>
</tr>
<tr>
<td bgcolor='#FFFFFF' align='center'><font face='Arial' size='2'><b>Address2</b></font></td>
<td bgcolor='#FFFFFF'><font face='Arial' size='2'>" . $laddress . "</font></td>
</tr>
<tr>
<td bgcolor='#FFFFFF' align='center'><font face='Arial' size='2'><b>State</b></font></td>
<td bgcolor='#FFFFFF'><font face='Arial' size='2'>" . $state . "</font></td>
</tr>
<tr>
<td bgcolor='#FFFFFF' align='center'><font face='Arial' size='2'><b>Country</b></font></td>
<td bgcolor='#FFFFFF'><font face='Arial' size='2'>" . $country . "</font></td>
</tr>
<tr>
<td bgcolor='#FFFFFF' align='center'><font face='Arial' size='2'><b>City</b></font></td>
<td bgcolor='#FFFFFF'><font face='Arial' size='2'>" . $city . "</font></td>
</tr>
<tr>
<td bgcolor='#FFFFFF' align='center'><font face='Arial' size='2'><b>Zip</b></font></td>
<td bgcolor='#FFFFFF'><font face='Arial' size='2'>" . $zip . "</font></td>
</tr>
<tr>
<td bgcolor='#FFFFFF' align='center'><font face='Arial' size='2'><b>Phone</b></font></td>
<td bgcolor='#FFFFFF'><font face='Arial' size='2'>" . $phone . "</font></td>
</tr>
<tr>
<td bgcolor='#FFFFFF' align='center'><font face='Arial' size='2'><b>Fax</b></font></td>
<td bgcolor='#FFFFFF'><font face='Arial' size='2'>" . $fax . "</font></td>
</tr>
<tr>
<td bgcolor='#FFFFFF' align='center'><font face='Arial' size='2'><b>Mobile</b></font></td>
<td bgcolor='#FFFFFF'><font face='Arial' size='2'>" . $mobile . "</font></td>
</tr>
<tr>
<td bgcolor='#FFFFFF' align='center'><font face='Arial' size='2'><b>Email</b></font></td>
<td bgcolor='#FFFFFF'><font face='Arial' size='2'>" . $email . "</font></td>
</tr>
<tr>
<td bgcolor='#FFFFFF' align='center'><font face='Arial' size='2'><b>Best Time</b></font></td>
<td bgcolor='#FFFFFF'><font face='Arial' size='2'>" . $best_time . "</font></td>
</tr>
<tr>
<td bgcolor='#FFFFFF' align='center'><font face='Arial' size='2'><b>Preferred</b></font></td>
<td bgcolor='#FFFFFF'><font face='Arial' size='2'>" . $preferred . "</font></td>
</tr>
<tr>
<td bgcolor='#FFFFFF' align='center'><font face='Arial' size='2'><b>Comments</b></font></td>
<td bgcolor='#FFFFFF'><font face='Arial' size='2'>" . $comments . "</font></td>
</tr>
</table>";
mail("EMAILADDRESS.GOES@HERE","Web Form Data",$mess,"From: $name<$email>\nReply-To: $email\nContent-Type: text/html; charset=ISO-8859-1\nX-Mailer: PHP/" . phpversion());
}
else{
echo "An unknown error occurred, please try again!";
}
?>