Hello im new here and found this site on google. I was hoping someone here could help me find problem. I created a form with html...i also created the php script to make the form work....but its not working for some reason. Im sure it will be something small....like a space or period where it shouldnt be.
Here's the html:
here's the php script:HTML Code:<table width="85%" border="1" cellpadding="5"> <tr> <td><form action="contactformprocess.php" method="post" enctype="multipart/form-data" name="form1" id="form1"> <p> <label><span class="contacttext">First Name: *</span> <input type="text" name="firstname" id="firstname" /> </label> </p> <p> <label><span class="contacttext">Last Name: *</span> <input type="text" name="lastname" id="lastname" /> </label> </p> <p> <label><span class="contacttext"> Phone # where you can be reached: </span> <input type="text" name="cellphone" id="cellphone" /> </label> </p> <p> <label><span class="contacttext">Email:*</span> <input type="text" name="email" id="email" /> </label> </p> <span class="contacttext">How do you prefer to be contacted?</span> <table width="200"> <tr> <td><label> <input type="checkbox" name="prefercontactemail" value="email" id="HowDoYouPreferToBeContacted_0" /> E-mail</label></td> </tr> <tr> <td><label> <input type="checkbox" name="prefercontactphone" value="phone" id="HowDoYouPreferToBeContacted_1" /> Phone</label></td> </tr> </table> <p> <p> <label><span class="contacttext">Where Did You Originally Hear Of Us? *</span> <input type="text" name="reference" id="reference" /> </label> <p> <label><span class="contacttext">Comments and Concerns: *</span><br /> <textarea name="comments" id="comments" cols="50" rows="5"></textarea> </label> </p> <p> <label> <input name="submit" type="submit" id="submit" onclick="MM_validateForm('firstname','','R','lastname','','R','RisNum','cellphone','','NisNum','email','','RisEmail','reference','','R','comments','','R');return document.MM_returnValue" value="Submit" /> </label> <label> <input type="reset" name="reset" id="reset" value="Reset" /> </label> </p> <p> <input name="recipient" type="hidden" id="recipient" value="contactus@ape-xnutrition.com" /> <input name="redirect" type="hidden" id="redirect" value="thankyou.html" /> </p> </form></td> </tr> </table>
PHP Code:<?php
/* Subject and Email varibales */
$emailSubject = 'Contact Ape-X Nutrition';
$webMaster = 'contactus@ape-xnutrition.com';
/* Gathering Data Variables */
$firstnameField = $_POST['firstname'];
$lastnameField = $_POST['lastname'];
$cellphoneField = $_POST['cellphone'];
$emailField = $_POST['email'];
$prefercontactemailField = $_POST['prefercontactemail'];
$prefercontactphoneField = $_POST['prefercontactphone'];
$referenceField = $_POST['reference'];
$commentsField = $_POST['comments'];
$body = <<<EOD
<br><hr><br>
First Name: $firstname <br>
Last Name: $lastname <br>
Phone: $cellphone <br>
Email: $email <br>
Prefered to be contacted: $prefercontactemail <br>
Prefered to be contacted: $prefercontactphone <br>
Who referred you: $reference <br>
Comments: $comments <br>
EOD;
$headers = "From: $email\r\n";
$headers .= "Content-type: text/html\r\n";
$success = mail($webMaster, $emailSubject, $body, $headers);
/* Results rendered as html */
$theResults = <<<EOD
<html>
<head>
<title>Ape-x Nutrition</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style type="text/css">
<!--
body {
background-color: #f1f1f1;
font-family: Verdana, Arial, Helvetica, sans-serif;
font-size: 12px;
font-style: normal;
line-height: normal;
font-weight: normal;
color: #666666;
text-decoration: none;
}
-->
</style>
</head>
<div>
<div align="left">Thank you for your interest! Your email will be addressed shortly!</div>
</div>
</body>
</html>
EOD;
echo "$theResults";
?>


Reply With Quote


Bookmarks