Location: PHPKode > scripts > AGTC-PHP Form Mailer > agtc-php-form-mailer-v2-0a/contact.php
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>AGTC Form Mailer</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
<body>
<link href="style.css" rel="stylesheet" type="text/css">
<?php include("configure.php");
if (isset($_POST['submit'])) {
if (!eregi("^[A-Z0-9._%-]+@[A-Z0-9._%-]+\.[A-Z]{2,6}$", $sendemail)) 
{
$msg="<br><font face='arial' color ='red'>There was an error on your form, your email is incorrect, please enter a valid email as indicated by the *";
$pass="false";
$error4 = "<b><font face='arial' color ='red' size='5'>*</font></b>";
$style9 = "error";}
 
if ($fname == ""){ 
$msg="<br><font face='arial' color ='red'>There was an error on your form, indicated by the *";
$error1 = "<b><font face='arial' color ='red' size='5'>*</font></b>";
$pass="false";
$style1 = "error";}

if($snopt == true){
if ($sname == ""){ 
$msg="<br><font face='arial' color ='red'>There was an error on your form, indicated by the *";
$error5 = "<b><font face='arial' color ='red' size='5'>*</font></b>";
$pass="false";
$style2 = "error";}}

if($htopt == true){
if ($telh == ""){ 
$msg="<br><font face='arial' color ='red'>There was an error on your form, indicated by the *";
$error6 = "<b><font face='arial' color ='red' size='5'>*</font></b>";
$pass="false";
$style4 = "error";}}

if ($sendemail == ""){ 
$msg="<br><font face='arial' color ='red'>There was an error on your form, indicated by the *";
$pass="false";
$error2 = "<b><font face='arial' color ='red' size='5'>*</font></b>";
$style9 = "error";}

if ($com == ""){ 
$msg="<br><font face='arial' color ='red'>There was an error on your form, indicated by the *";
$pass="false";
$error3 = "<b><font face='arial' color ='red' size='5'>*</font></b>";
$style8 = "error";}

echo $msg;
if (!$pass) {
if (!isset($email)) 
echo "Error, Please re-send $fname" ; 

$todayis = date("l, F j, Y, g:i a") ;

$message ="$todayis [EST] \n";
$message .="From: $fname $sname ($sendemail)\n";
if($htopt == true){$message .="Home Tel : $telh \n";}
if($wtopt == true){$message .="Work Tel : $telw \n";}
if($mtopt == true){$message .="Mobile Tel : $telm \n";}
if($ftopt == true){$message .="Fax Tel : $telf \n";}
if($adopt == true){$message .="Address : $add \n";}
$message .="Comment: $com \n";

$from = "From: $email\r\n";

if ($email != "") 
mail($email, $subject, $message, $from);

?>


<table width="80%" align="center"><tr><td>
<center><img src="../images/tick.jpg"></center>
<b><p align="center">
Date Sent: <?php echo $todayis ?> 
<br>
Sent By: <?php echo $fname ?> ( <?php echo $sendemail ?> ) 
<br>
<br>Thank you your email has been sent, we will respond to you within 48 hours.
<br>
<a href="javascript:history.go(-2)"> <<<< Back <<<< </a></td></tr></table>
<?php exit();}} ?>


<link href="style.css" rel="stylesheet" type="text/css">
<table width="80%"  border="0" cellpadding="5">
  <tr>
    <th align="left" valign="top" scope="col">
	
      <p align="left" class="stdtxtlocate"><h4><?php echo $formheader ?></h4></th>
  </tr>
 <tr>
    <th align="left" valign="top" scope="col">
	
      <p align="left" class="stdtxt"><?php echo $formintro ?>.<br><br><br>Fields marked with * are required.      
     <form action="" method="post"> <table width="80%"  border="0" cellpadding="5">
        <tr>
          <td width="26%" scope="col">First Name<font size="+2">*</font> </td>
          <td width="74%" scope="col"><input name="fname" type="text" size="40" maxlength="40" value="<?php echo $_POST['fname']; ?>" class="<?php echo $style1; ?>"><?php echo $error1; ?></td>
        </tr>
        <?php if ($snopt == true) { ?><tr>
          <td>Surname<font size="+2">*</font></td>
          <td><input name="sname" type="text" size="40" maxlength="40" value="<?php echo $_POST['sname']; ?>" class="<?php echo $style2; ?>"><?php echo $error5; ?></td>
        </tr><?php } ?>
        <?php if ($adopt == true) { ?><tr>
          <td>Address</td>
          <td><input name="add" type="text" size="40" maxlength="40" value="<?php echo $_POST['add']; ?>" class="<?php echo $style3; ?>"></td>
        </tr><?php } ?>
        <?php if ($htopt == true) { ?><tr>
          <td>Tel Number<font size="+2">*</font></td>
          <td><input name="telh" type="text" size="40" maxlength="40" value="<?php echo $_POST['telh']; ?>" class="<?php echo $style4; ?>"><?php echo $error6; ?></td>
        </tr><?php } ?>
        <?php if ($wtopt == true) { ?><tr>
          <td>Tel Number Work </td>
          <td><input name="telw" type="text" size="40" maxlength="40" value="<?php echo $_POST['telw']; ?>" class="<?php echo $style5; ?>"></td>
        </tr><?php } ?>
        <?php if ($ftopt == true) { ?><tr>
          <td>Fax Number </td>
          <td><input name="telf" type="text" size="40" maxlength="40" value="<?php echo $_POST['telf']; ?>" class="<?php echo $style6; ?>"></td>
        </tr><?php } ?>
        <?php if ($mtopt == true) { ?><tr>
          <td>Mobile Number </td>
          <td><input name="telm" type="text" size="40" maxlength="40" value="<?php echo $_POST['telm']; ?>" class="<?php echo $style7; ?>"></td>
        </tr><?php } ?>
        <tr>
          <td>Comments<font size="+2">*</font></td>
          <td><textarea name="com" rows="10" cols="40" class="<?php echo $style8; ?>"><?php echo $_POST['com']; ?></textarea><?php echo $error3; ?></td>
        </tr>
        <tr>
          <td>Email Address<font size="+2">*</font> </td>
          <td><input name="sendemail" type="text" size="40" maxlength="40" value="<?php echo $_POST['sendemail']; ?>" class="<?php echo $style9; ?>"><?php echo $error4; ?></td>
        </tr>
        <tr>
          <td>&nbsp;</td>
          <td><input type="submit" name="submit" value="Submit"></td>
        </tr>
      </table></form><p align="left" class="stdtxt"></th>
  </tr> 
  
</table>
<!-- DO NOT REMOVE THIS COPYRIGHT NOTICE BELOW-->
<a href="http://www.agtc.co.uk" class="small_red_text">Copyright 2005-2006 &copy;AGTC-PHP Form Mailer v2.0a</a>
</body>
</html>
Return current item: AGTC-PHP Form Mailer