All pastes #553372 Raw Edit

xjstrx

public text v1 · immutable
·published 2007-06-09 18:05 UTC
rendered paste body
<? require("doc.php"); ?>

<div class="content">
        <p>
<?php
	$EmailFrom = $_POST['EmailFrom'];
        $Subject = "Web Form Submission"; /// Add a subject
	$first_name = Trim($_POST['first_name']);
	$last_name  = Trim($_POST['last_name']);
	$address    = Trim($_POST['address']);
	$city       = Trim($_POST['city']);
	$state      = Trim($_POST['state']);
	$zip_code   = Trim($_POST['zip_code']);
	$phone      = Trim($_POST['phone']);
	$comments   = Trim($_POST['comments']);
	$EmailTo    = "email@url.com";

	$validationOK=true;
	 if (Trim($EmailFrom)=="") $validationOK=false;
	 if (!$validationOK) 
          {
           echo "Your Email was not sent. Please make sure you entered a valid email address.<br />
	    <form id='FormName' action='send_mail.php' method='post' name='FormName'>
  	    <label for='subject'>Subject</label>
         <select id='subject' name='subject'>
          <option value='Customer Service'>Customer Support</option>
          <option value='Sales'>Sales</option>
          <option value='Sample Request'>Sample Request</option>
          <option value='Other'>Other</option>
         </select><br />
  	    <label for='first_name'>First Name</label>
             <input id='first_name' name='first_name' type='text' size='25' value=''                                        maxlength='255'><br />
            <label for='last_name'>Last Name</label>
             <input id='last_name' name='last_name' type='text' size='25' value=''                                          maxlength='255'><br />
            <label for='address'>Address</label>
             <input id='address' name='address' type='text' size='25' value='' maxlength='255'>
              <br />
            <label for='city'>City</label>
             <input id='city' name='city' type='text' size='25' value='' maxlength='255'><br />
            <label for='state'>State</label>
             <input id='state' name='state' type='text' size='25' value='' maxlength='255'><br />
            <label for='zip_code'>Zip Code</label>
             <input id='zip_code' name='zip_code' type='text' size='25' value=''                                            maxlength='255'><br />
            <label for='phone'>Phone</label>
             <input id='phone' name='phone' type='text' size='25' value='' maxlength='255'><br />
            <label for='EmailFrom'>Your email</label>
             <input id='EmailFrom' type='text' name='EmailFrom' size='25'>
                        <b>Valid Email Required</b><br />
            <label for='comments'>Comments</label>
             <textarea id='comments' name='comments' rows='4' cols='20'></textarea><br />
           <div style='margin-left: 132px; top-margin: 10px;'>
             <input type='submit' name='submitButtonName' id='submitButtonName' value='Send Email'>
             <input type='reset' value='Reset' />
           </div>
	  </form>
	

";
  exit;
}


$Body = "";
$Body .= "Subject:\n$subject\n\n";
$Body .= "First Name:\n$first_name\n\n";
$Body .= "Last Name:\n$last_name\n\n";
$Body .= "Address:\n$address\n\n";
$Body .= "City:\n$city\n\n";
$Body .= "State:\n$state\n\n";
$Body .= "Zip Code:\n$zip_code\n\n";
$Body .= "Phone:\n$phone\n\n";
$Body .= "Email:\n$EmailFrom\n\n";
$Body .= "Comments:\n$comments\n\n";

if($Subject == NULL) {$Subject = "$Subject";}
$success = mail($EmailTo, $Subject, $Body, "From: <$EmailFrom>");

if ($success)
 { 
   echo "
        <p>
	   Thank you for choosing N2itive Designs for your web and print needs.<br />
           Please allow us 24-48 hours to get in touch with you.<br />
           <br />
           1. Your Service Team<br />
           An account manager will be assigned to take primary responsibility for seeing that your             needs are met and for supervising all work we undertake on your behalf. 
           <br />
           <br />
           The responsible manager will also determine the appropriate additional staffing for each            matter you entrust to us. 
           We are always pleased to discuss the staffing of a particular transaction or other            matter with you.
           <br />
           <br />
           2. Scope of Our Role<br />
           The scope of our role for each specific matter you entrust to us will be confirmed in            continued communications between us as work progresses. We will not expand the scope of             our engagement without instructions from you.<br /><br />
           We look forward to working with you.<br /><br />
<a href='index.php'>Take me Home</a>
        </p>";
}

?>
        </p>
</div>

<? require("footer.php"); ?>