Can't get form to show up at email address.
09-13-2009, 10:38 AM
|
Can't get form to show up at email address.
|
Posts: 5
Name: Charlie
|
I am trying to create a form/application that sends to an email address. I have been working on it for a month trying to get it to work and being almost completely new using CSS and PHP code I am stumped. I get it to the point where the submit button works but nothing shows up in my inbox. Please help not sure what else to do. And I appoligize in advance if my code is messy and looks wrong to you veterans out there.
Here is the website: www weinsureusa.com
Here is the page I have working the best:
Here is my html code:
Code:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>We Insure USA</title>
<meta name="description" content="Insurance at great rates with great providers. Health, auto, life, and home care is provided.">
<meta name="keywords" content="insurance, life, health, auto, home, house">
<link rel="stylesheet" href="weinusa.css" type="text/css" />
<style type="text/css" id="container">
<!--
body {
background-color: #006699;
font-size:16px;
font-family:"Times New Roman", Times, serif;
}
label
{
width: 20em;
float: left;
text-align: left;
margin: 0 1em 155px 0
clear: both
}
textarea{
width: 250px;
height: 150px;
}
.input-box
{
margin-bottom: 10px }
.styled
{
margin-bottom: 20px }
.radio-box
{
margin-bottom: 30px }
.radiotwo-box
{
margin-bottom: 60px }
.radiothree-box
{
margin-bottom: 80px }
.submit-button
{
margin-left: 10em;
clear: both
}
a:link {
text-decoration: none;
}
a:visited {
text-decoration: none;
color: #00446B;
}
a:hover {
color: #FF0000;
text-decoration: none;
}
a:active {
text-decoration: none;
color: #F0F0F0;
}
.style1 {
color: #006699;
background-color: #CCCCCC;
}
-->
</style>
<script src="Scripts/AC_RunActiveContent.js" type="text/javascript"></script>
<div id="conash3D0"></div>
</head>
<body>
<div id="wrapper"></div>
<div id="container">
<div id="bg"></div>
<div id="headerauto"></div>
<div id="nav"></div>
<div id="linklife"><a href="life.html"><img src="pieces/lifelink.gif" width="38" height="25" border="0" /></a></div>
<div id="linkauto"><a href="auto.html"><img src="pieces/autolink.gif" width="50" height="21" border="0" /></a></div>
<div id="linkhome"><a href="home.html"><img src="pieces/homelink.gif" width="56" height="23" border="0" /></a></div>
<div id="linkhealth"><a href="health.html"><img src="pieces/healthlink.gif" width="64" height="25" border="0" /></a></div>
<div id="titleauto"></div>
<div id="body"></div>
<div id="text">
<p>Please take the time to complete this form accurately. An agent will be with you as soon as possible.</p>
<div id="texttwo"><p><center class="style1">Driver Information:</center><br/><p>
</div><br>
<form action="send_form_email.php" method='post' enctype='multipart/form-data'>
<label for="name">First Name:</label>
<input id="name" name="name" type="text"class="input-box" /><br>
<label for="lastName">Last Name:</label>
<input id="lastName" name="lastName" type="text" class="input-box" /><br>
<label for="drivenumber">Drivers License Number:</label>
<input id="drivenumber" name="drivenumber" type="text" class="input-box" /><br>
<label for="statelist">State Issued:</label>
<select name="statelist" id="statelist">
<option>Select One</option>
<option>Alabama</option>
<option>Alaska</option>
<option>Arizona</option>
<option>Arkansas</option>
<option>California</option>
<option>Colorado</option>
<option>Connecticut</option>
<option>Delaware</option>
<option>District of Columbia</option>
<option>Florida</option>
<option>Georgia</option>
<option>Hawaii</option>
<option>Idaho</option>
<option>Illinois</option>
<option>Indiana</option>
<option>Iowa</option>
<option>Kansas</option>
<option>Kentucky</option>
<option>Louisiana</option>
<option>Maine</option>
<option>Maryland</option>
<option>Massachusetts</option>
<option>Michigan</option>
<option>Minnesota</option>
<option>Mississippi</option>
<option>Missouri</option>
<option>Montana</option>
<option>Nebraska</option>
<option>Nevada</option>
<option>New Hampshire</option>
<option>New Jersey</option>
<option>New Mexico</option>
<option>New York</option>
<option>North Carolina</option>
<option>North Dakota</option>
<option>Ohio</option>
<option>Oklahoma</option>
<option>Oregon</option>
<option>Pennsylvania</option>
<option>Rhode Island</option>
<option>South Carolina</option>
<option>South Dakota</option>
<option>Tennessee</option>
<option>Texas</option>
<option>Utah</option>
<option>Vermont</option>
<option>Virginia</option>
<option>Washington</option>
<option>West Virginia</option>
<option>Wisconsin</option>
<option>Wyoming</option>
</select>
<br><P>
<label for="yearlic">Years Licensed:</label>
<input id="yearlic" name="yearlic" type="text" class="input-box" /><br>
<label for="birthdate">What is your date of birth(MM/DD/YYYY):</label>
<input id="birthdate" name="birthdate" type="text" class="input-box" /><br><p>
<label for="gender">What is your gender:</label>
<input type="radio" name="gender" value="1" class="input-box"> Male
<input type="radio" name="gender" value="2" class="input-box"> Female<br><P>
<label for="status">What is your marital status:</label>
<select name="status" id="status">
<option>Select One</option>
<option>single</option>
<option>married</option>
<option>widowed</option>
<option>divorced</option>
<option>seperated</option>
</select>
<br><P>
<label for="autocom">Name of Current Auto Insurance Company:</label>
<input id="autocom" name="autocom" type="text"class="input-box" /><br>
<div id="texttwo"><p><center class="style1">Contact Information:</center><br/><p>
</div><br>
<label for="addName">Address:</label>
<input id="addName" name="addname" type="text" class="input-box" /><br>
<label for="addName">Address:</label>
<input id="addName" name="addName" type="text" class="input-box" /><br>
<label for="cityName">City:</label>
<input id="cityName" name="cityName" type="text" class="input-box" /><br>
<label for="statelist">State:</label>
<select name="statelist" id="statelist">
<option>Select One</option>
<option>Alabama</option>
<option>Alaska</option>
<option>Arizona</option>
<option>Arkansas</option>
<option>California</option>
<option>Colorado</option>
<option>Connecticut</option>
<option>Delaware</option>
<option>District of Columbia</option>
<option>Florida</option>
<option>Georgia</option>
<option>Hawaii</option>
<option>Idaho</option>
<option>Illinois</option>
<option>Indiana</option>
<option>Iowa</option>
<option>Kansas</option>
<option>Kentucky</option>
<option>Louisiana</option>
<option>Maine</option>
<option>Maryland</option>
<option>Massachusetts</option>
<option>Michigan</option>
<option>Minnesota</option>
<option>Mississippi</option>
<option>Missouri</option>
<option>Montana</option>
<option>Nebraska</option>
<option>Nevada</option>
<option>New Hampshire</option>
<option>New Jersey</option>
<option>New Mexico</option>
<option>New York</option>
<option>North Carolina</option>
<option>North Dakota</option>
<option>Ohio</option>
<option>Oklahoma</option>
<option>Oregon</option>
<option>Pennsylvania</option>
<option>Rhode Island</option>
<option>South Carolina</option>
<option>South Dakota</option>
<option>Tennessee</option>
<option>Texas</option>
<option>Utah</option>
<option>Vermont</option>
<option>Virginia</option>
<option>Washington</option>
<option>West Virginia</option>
<option>Wisconsin</option>
<option>Wyoming</option>
</select>
<br><p>
<label for="zipName">Zip Code:</label>
<input id="zipName" name="zipName" type="text" class="input-box" /><br>
<label for="primphone">Primary Phone:</label>
<input id="primphone" name="primphone" type="text" class="input-box" /><br>
<label for="email">Email:</label>
<input id="email" name="email" type="text" class="input-box" /><br>
<label for="besttime">Best Time to Contact:</label>
<select name="besttime" id="besttime">
<option>Select One</option>
<option>Morning</option>
<option>Afternoon</option>
<option>Evening</option>
</select>
<br><P>
<div id="texttwo"><p><center class="style1">Driver History:</center><br/><p>
</div><br>
<label for="dui">Any DUI or DWI in the last 5 years?</label>
<input type="radio" name="dui" value="1" class="input-box"> Yes
<input type="radio" name="dui" value="2" class="input-box"> No<br><P>
<label for="suspended">Has your license been suspended in the last 5 years?</label>
<input type="radio" name="suspended" value="1" class="input-box"> Yes
<input type="radio" name="suspended" value="2" class="input-box"> No<br><P>
<label for="revoked">Has your license been revoked in the last 5 years?</label>
<input type="radio" name="revoked" value="1" class="input-box"> Yes
<input type="radio" name="revoked" value="2" class="input-box"> No<br><P>
<label for="sr22">Do you require a SR-22?</label>
<input type="radio" name="sr22" value="1" class="input-box"> Yes
<input type="radio" name="sr22" value="2" class="input-box"> No<br><P>
<label for="traficvio">Number of moving violations in the last 4 years:
(Speeding, Stop Sign, Etc.)</label>
<select name="traficvio" id="traficvio">
<option>Select One</option>
<option>0</option>
<option>1</option>
<option>2</option>
<option>3</option>
<option>4</option>
<option>5 or more</option>
</select>
<br><P>
<label for="traficacc">Number of Accidents in the last 4 years:</label>
<select name="traficacc" id="traficacc">
<option>Select One</option>
<option>0</option>
<option>1</option>
<option>2</option>
<option>3</option>
<option>4</option>
<option>5 or more</option>
</select>
<br><P>
<div id="texttwo"><p><center class="style1">Vehicle Information:</center><br/><p>
</div><br>
<label for="vy">Vehicle Year:</label>
<input id="vy" name="vy" type="text" class="input-box" /><br>
<label for="vm">Vehicle Make:</label>
<input id="vm" name="vm" type="text" class="input-box" /><br>
<label for="vmod">Vehicle Model:</label>
<input id="vmod" name="vmod" type="text" class="input-box" /><br>
<label for="annmiles">Annual Miles:</label>
<select name="annmiles" id="annmiles">
<option>Select One</option>
<option>0-5,000</option>
<option>5,001-10,000</option>
<option>10,000-15,000</option>
<option>15,001-20,000</option>
<option>20,000 or more</option>
</select>
<br><P>
<label for="autouse">Auto Use:</label>
<select name="autouse" id="autouse">
<option>Select One</option>
<option>Commute To/From Work</option>
<option>Commute To/From School</option>
<option>Pleasure</option>
<option>Business</option>
<option>Government</option>
<option>Farm</option>
<option>Other</option>
</select>
<br><P>
<label for="vin">VIN Number:</label>
<input id="vin" name="vin" type="text" class="input-box" /><br>
<label for="abs">Anti-Lock Brackes(ABS)?</label>
<input type="radio" name="abs" value="1" class="input-box"> Yes
<input type="radio" name="abs" value="2" class="input-box"> No<br><P>
<div id="texttwo"><p><center class="style1">Additional Vehicle Information:</center><br/><p>
</div><br>
<label for="addcomments">Please list all other vechiles you would like us to consider:
</label>
<textarea name="addcomments"></textarea><br /><P>
<div id="texttwo"><p><center class="style1">Additional Driver Information:</center><br/><p>
</div><br>
<label for="addcomments">Please provide any additional drivers you would like to insure:
</label>
<textarea name="addcomments"></textarea><br /><P>
<input type="submit" />
</form>
<P>
* Please note that the insurance professional receiving your policy application may need to view your credit to
provide you with the most accurate quote.
</div>
<div id="btmnav"></div>
<div id="lifeins"><a href="life.html"><img src="pieces/imglink1.gif" width="101" height="71" border="0" /></a></div>
<div id="autoins"><a href="auto.html"><img src="pieces/imglink2.gif" width="78" height="72" border="0" /></a></div>
<div id="homeins"><a href="home.html"><img src="pieces/imglink3.gif" width="91" height="66" border="0" /></a></div>
<div id="healthins"><a href="health.html"><img src="pieces/imglink4.gif" width="106" height="70" border="0" /></a></div>
<div class="style5" id="linkhomepage">
<div align="center"><a href="index.html">Home</a></div>
</div>
<div id="linkcontact">
<div align="center" class="style5"><a href="contact.html">Contact Us</a></div>
</div>
<div id="linkprivacy">
<div align="center" class="style5">Privacy</div>
</div>
<div class="style6" id="linkterms">
<div align="center">Terms and Conditions</div>
</div>
</div>
</body>
</html>
Here is my css:
Code:
container {
visibility: visible;
width: 700px;
top: 14px;
margin: 0 auto;
position: relative;
}
#header {
font-family: "Times New Roman", Times, serif;
font-size: 8px;
overflow: visible;
visibility: visible;
position: absolute;
background-repeat: no-repeat;
background-attachment: scroll;
background-position: 0px 0px;
height: 147px;
width: 700px;
right: 100px;
left: 0px;
top: -3px;
background-image: url(pieces/header.gif);
}
#headerlife {
font-family: "Times New Roman", Times, serif;
font-size: 8px;
overflow: visible;
visibility: visible;
height: 147px;
width: 700px;
left: 0px;
top: -3px;
background-attachment: scroll;
background-image: url(headerlife.gif);
background-repeat: no-repeat;
position: absolute;
}
#headerauto {
font-family: "Times New Roman", Times, serif;
font-size: 8px;
overflow: visible;
visibility: visible;
height: 147px;
width: 700px;
left: 0px;
top: -3px;
background-attachment: scroll;
background-image: url(pieces/headerauto.gif);
background-repeat: no-repeat;
position: absolute;
}
#headerhome {
font-family: "Times New Roman", Times, serif;
font-size: 8px;
overflow: visible;
visibility: visible;
height: 147px;
width: 700px;
left: 0px;
top: -3px;
background-attachment: scroll;
background-image: url(pieces/headerhome.gif);
background-repeat: no-repeat;
position: absolute;
}
#headercontact {
font-family: "Times New Roman", Times, serif;
font-size: 8px;
overflow: visible;
visibility: visible;
height: 147px;
width: 700px;
left: 0px;
top: -3px;
background-attachment: scroll;
background-image: url(pieces/headercontact.gif);
background-repeat: no-repeat;
position: absolute;
}
#headerhealth {
font-family: "Times New Roman", Times, serif;
font-size: 8px;
overflow: visible;
visibility: visible;
height: 147px;
width: 700px;
left: 0px;
top: -3px;
background-attachment: scroll;
background-image: url(pieces/headerhealth.gif);
background-repeat: no-repeat;
position: absolute;
}
#nav {
font-family: "Times New Roman", Times, serif;
font-size: 8px;
overflow: visible;
visibility: visible;
background-image: url(navtopbar.gif);
background-repeat: no-repeat;
background-attachment: scroll;
height: 132px;
width: 700px;
left: 0px;
top: 144px;
float: none;
position: absolute;
}
#titlehome {
font-family: "Times New Roman", Times, serif;
font-size: 8px;
overflow: visible;
visibility: visible;
background-image: url(pieces/titlehome.gif);
background-repeat: no-repeat;
background-attachment: scroll;
height: 118px;
width: 700px;
right: 0px;
float: none;
clear: none;
position: absolute;
top: 276px;
}
#titlecontact {
font-family: "Times New Roman", Times, serif;
font-size: 8px;
overflow: visible;
visibility: visible;
background-repeat: no-repeat;
background-attachment: scroll;
height: 118px;
width: 700px;
right: 0px;
float: none;
clear: none;
position: absolute;
top: 276px;
background-color: #FFFFFF;
}
#titlehealth {
font-family: "Times New Roman", Times, serif;
font-size: 8px;
overflow: visible;
visibility: visible;
background-image: url(pieces/titlehealth.gif);
background-repeat: no-repeat;
background-attachment: scroll;
height: 118px;
width: 700px;
right: 0px;
float: none;
clear: none;
position: absolute;
top: 276px;
}
#titlewelcome {
font-family: "Times New Roman", Times, serif;
font-size: 8px;
overflow: visible;
visibility: visible;
background-image: url(titlewelcome.gif);
background-repeat: no-repeat;
background-attachment: scroll;
height: 118px;
width: 700px;
right: 0px;
float: none;
clear: none;
position: absolute;
top: 276px;
}
#titleauto {
font-family: "Times New Roman", Times, serif;
font-size: 8px;
overflow: visible;
visibility: visible;
background-image: url(pieces/titleauto.gif);
background-repeat: no-repeat;
background-attachment: scroll;
height: 118px;
width: 700px;
right: 0px;
float: none;
clear: none;
position: absolute;
top: 276px;
}
#titlelife {
font-family: "Times New Roman", Times, serif;
font-size: 8px;
overflow: visible;
visibility: visible;
background-image: url(titlelife.gif);
background-repeat: no-repeat;
background-attachment: scroll;
height: 118px;
width: 700px;
right: 0px;
float: none;
clear: none;
position: absolute;
top: 276px;
}
#body {
font-family: "Times New Roman", Times, serif;
font-size: 8px;
overflow: visible;
visibility: visible;
background-image: url(pieces/bg.gif);
background-repeat: no-repeat;
background-attachment: scroll;
height: 995px;
width: 700px;
position: absolute;
top: 394px;
left: 0px;
z-index: 10;
}
#bodytwo {
font-family: "Times New Roman", Times, serif;
font-size: 8px;
overflow: visible;
visibility: visible;
background-image: url(pieces/bg.gif);
background-repeat: no-repeat;
background-attachment: scroll;
height: 800px;
width: 700px;
position: absolute;
top: 394px;
left: 0px;
z-index: 10;
}
#btmnav {
font-family: "Times New Roman", Times, serif;
font-size: 8px;
overflow: visible;
visibility: visible;
background-image: url(pieces/btmnav.gif);
background-repeat: no-repeat;
background-attachment: scroll;
background-position: left bottom;
height: 32px;
width: 702px;
float: none;
clear: none;
position: absolute;
left: 0px;
top: 1353px;
z-index: 50;
}
#lifeins {
font-family: "Times New Roman", Times, serif;
height: 71px;
width: 101px;
overflow: visible;
position: absolute;
visibility: visible;
z-index: 5;
left: 268px;
top: 168px;
}
#autoins {
font-family: "Times New Roman", Times, serif;
height: 72px;
width: 78px;
overflow: visible;
position: absolute;
visibility: visible;
z-index: 60;
left: 389px;
top: 166px;
}
#homeins {
font-family: "Times New Roman", Times, serif;
height: 66px;
width: 91px;
overflow: visible;
position: absolute;
visibility: visible;
left: 479px;
top: 172px;
}
#healthins {
font-family: "Times New Roman", Times, serif;
height: 70px;
width: 106px;
overflow: visible;
position: absolute;
visibility: visible;
z-index: 60;
left: 582px;
top: 168px;
}
#linkhealth {
font-family: "Times New Roman", Times, serif;
height: 28px;
width: 68px;
overflow: visible;
position: absolute;
visibility: visible;
z-index: 25;
left: 604px;
top: 245px;
}
#linkhome {
font-family: "Times New Roman", Times, serif;
height: 26px;
width: 61px;
overflow: visible;
position: absolute;
visibility: visible;
z-index: 20;
left: 499px;
top: 247px;
}
#linkauto {
font-family: "Times New Roman", Times, serif;
height: 26px;
width: 50px;
overflow: visible;
position: absolute;
visibility: visible;
z-index: 15;
left: 407px;
top: 249px;
}
#linklife {
font-family: "Times New Roman", Times, serif;
height: 26px;
width: 45px;
overflow: visible;
position: absolute;
visibility: visible;
z-index: 10;
left: 308px;
top: 248px;
}
#linkhomepage {
font-family: "Times New Roman", Times, serif;
height: 24px;
width: 52px;
overflow: visible;
position: absolute;
visibility: visible;
z-index: 60;
left: 221px;
top: 1356px;
background-color: #CCCCCC;
font-size: 16px;
font-style: normal;
}
#linkcontact {
font-family: "Times New Roman", Times, serif;
height: 23px;
width: 82px;
overflow: visible;
position: absolute;
visibility: visible;
z-index: 60;
left: 296px;
top: 1356px;
font-size: 16px;
font-style: normal;
background-color: #CCCCCC;
}
#linkprivacy {
font-family: "Times New Roman", Times, serif;
height: 23px;
width: 67px;
overflow: visible;
position: absolute;
visibility: visible;
z-index: 60;
left: 399px;
top: 1355px;
font-size: 16px;
font-style: normal;
background-color: #CCCCCC;
}
#linkterms {
font-family: "Times New Roman", Times, serif;
height: 27px;
width: 144px;
overflow: visible;
position: absolute;
visibility: visible;
z-index: 60;
left: 482px;
top: 1355px;
font-size: 16px;
font-style: normal;
background-color: #CCCCCC;
}
#text {
font-size: 16px;
font-style: normal;
color: #333333;
background-attachment: scroll;
background-color: #FFFFFF;
background-repeat: no-repeat;
overflow: scroll;
visibility: visible;
height: 869px;
width: 653px;
float: none;
position: absolute;
z-index: 25;
border-top-style: none;
border-right-style: none;
border-bottom-style: none;
border-left-style: none;
border-top-color: #00446B;
border-right-color: #00446B;
border-bottom-color: #00446B;
border-left-color: #00446B;
clear: left;
left: 19px;
top: 415px;
}
#texthome {
font-size: 16px;
font-style: normal;
color: #333333;
background-color: #FFFFFF;
background-repeat: no-repeat;
overflow: visible;
visibility: visible;
height: 151px;
width: 571px;
float: none;
position: absolute;
left: 72px;
top: 399px;
z-index: 25;
}
#texttwo {
font-family: Arial, Helvetica, sans-serif;
font-size: 14px;
font-style: normal;
line-height: normal;
color: #003366;
background-color: #CCCCCC;
vertical-align: text-bottom;
text-align: center;
border-top-width: thin;
border-right-width: thin;
border-bottom-width: thin;
border-left-width: thin;
border-top-style: solid;
border-top-color: #CCCCCC;
border-right-color: #CCCCCC;
border-bottom-color: #CCCCCC;
border-left-color: #CCCCCC;
}
#textthree {
font-family: Arial, Helvetica, sans-serif;
font-size: 12px;
color: #003366;
text-align: left;
border: thin solid #CCCCCC;
}
#flash {
background-attachment: fixed;
background-repeat: no-repeat;
overflow: visible;
position: absolute;
visibility: visible;
height: 290px;
width: 550px;
left: 77px;
top: 775px;
}
#conash3D0
{
display:none;
}
And here is my PHP:
Code:
<?php
if(isset($_POST['email'])) {
// EDIT THE 2 LINES BELOW AS REQUIRED
$email_to = "info@weinsureusa.com";
$email_subject = "Weinsureusa Form";
function died($error) {
// your error code can go here
echo "We are very sorry, but there were error(s) found with the form your submitted. ";
echo "These errors appear below.<br /><br />";
echo $error."<br /><br />";
echo "Please go back and fix these errors.<br /><br />";
die();
}
// validation expected data exists
if(!isset($_POST['name']) ||
!isset($_POST['lastName']) ||
!isset($_POST['email']) ||
!isset($_POST['gender']) ||
!isset($_POST['status'])) {
died('We are sorry, but there appears to be a problem with the form your submitted.');
}
$name = $_POST['name']; // required
$lastName = $_POST['lastName']; // required
$email = $_POST['email']; // required
$gender = $_POST['gender']; // not required
$status = $_POST['status']; // required
//$error_message = "";
//$email_exp = "^[A-Z0-9._%-]+@[A-Z0-9.-]+\.[A-Z]{2,4}$";
//if(!eregi($email_exp,$email_from)) {
//$error_message .= 'The Email Address you entered does not appear to be valid.<br />';
//}
$string_exp = "^[a-z .'-]+$";
if(!eregi($string_exp,$name)) {
$error_message .= 'The First Name you entered does not appear to be valid.<br />';
}
if(!eregi($string_exp,$lastName)) {
$error_message .= 'The Last Name you entered does not appear to be valid.<br />';
}
if(strlen($status) < 2) {
$error_message .= 'The Comments you entered do not appear to be valid.<br />';
}
$string_exp = "^[0-9 .-]+$";
if(!eregi($string_exp,$gender)) {
$error_message .= 'The Telphone Number you entered does not appear to be valid.<br />';
}
if(strlen($error_message) > 0) {
died($error_message);
}
$email_message = "Form details below.\n\n";
function clean_string($string) {
$bad = array("content-type","bcc:","to:","cc:","href");
return str_replace($bad,"",$string);
}
$email_message .= "First Name: ".clean_string($name)."\n";
$email_message .= "Last Name: ".clean_string($lastName)."\n";
$email_message .= "Email: ".clean_string($email)."\n";
$email_message .= "Gender: ".clean_string($gender)."\n";
$email_message .= "Status: ".clean_string($status)."\n";
// create email headers
$headers = 'From: '.$email_from."\r\n".
'Reply-To: '.$email_from."\r\n" .
'X-Mailer: PHP/' . phpversion();
@mail($email_to, $email_subject, $email_message, $headers);
?>
<!-- include your own success html here -->
Thank you for contacting us. We will be in touch with you very soon.
<?
}
?>
Again sorry if it looks like I am all over the place here but still learning all three of these coding types. The PHP and CSS are on seperate pages then the HTML. I am assuming that is the correct way to do it.
Thanks in Advance,
Charlie
Last edited by chrishirst; 09-13-2009 at 10:40 AM..
Reason: link drops removed
|
|
|
|
09-13-2009, 02:39 PM
|
Re: Can't get form to show up at email address.
|
Posts: 744
Name: Mattias Nordahl
Location: Sweden
|
Are you getting any error messages? If not, remove the @ before the mail() function and if you get any error messages or warning post them here. The @ surpresses any warnings, so you shouln't use them while developing/debugging.
__________________
34343639363436653237373432303635373837303635363337 34323037343638363137343263323036343639363432303739 366637353366
|
|
|
|
09-13-2009, 08:55 PM
|
Re: Can't get form to show up at email address.
|
Posts: 5
Name: Charlie
|
My PHP doesnt seem to have any errors but it seems my HTML has quite a few that didn't show up before I put it into an HTML validation site. Not sure if that will make a difference or not but I'll get a cracking on those right away and let you know what happens.
Thanks,
Charlie
|
|
|
|
09-14-2009, 02:08 AM
|
Re: Can't get form to show up at email address.
|
Posts: 42
Name: Prasanth
|
$email_from does not seems to have been initialized.
Try this change:
Code:
$headers = "From: info@weinsureusa.com\r\n".
"Reply-To: $email\r\n" ;
mail($email_to, $email_subject, $email_message, $headers);
The following pages might help:
email form, PHP Form to email
|
|
|
|
09-20-2009, 03:55 PM
|
Re: Can't get form to show up at email address.
|
Posts: 5
Name: Charlie
|
Sorry for the late response, I work out of town and only mess with sites on the weekends really. I tried the change and still not working. Although there is a new development.
Warning: mail() [function.mail]: SMTP server response: 451 See http://pobox.com/~djb/docs/smtplf.html. in D:\Hosting\4587454\html\send_form_email.php on line 73
Thank you for contacting us. We will be in touch with you very soon.
This error is popping up now. I am hoping its a good error. Meaning that it its the only error stopping me from retrieving the email. I went to the site it suggests and I had no clue what it was talking about. Any ideas?
|
|
|
|
09-20-2009, 05:03 PM
|
Re: Can't get form to show up at email address.
|
Posts: 118
Name: Brian Collins
|
wrong
Code:
@mail($email_to, $email_subject, $email_message, $headers);
correct
Code:
mail("$email_to", "$email_subject"," $email_message", "$headers");
This should work
This is from a line in my contact form that work so I hope it will work for you.
__________________
I hope to build a site with something for every one
Please login or register to view this content. Registration is FREE
Last edited by bmcoll3278; 09-20-2009 at 05:06 PM..
|
|
|
|
09-27-2009, 09:59 AM
|
Re: Can't get form to show up at email address.
|
Posts: 5
Name: Charlie
|
Nope, that didn't work either. I have had friends who are heavy code people and they still can't figure it out. I bet its something simple like a period somewhere where its not supposed to be.
|
|
|
|
09-27-2009, 10:07 AM
|
Re: Can't get form to show up at email address.
|
Posts: 5
Name: Charlie
|
Getting this error now. From what I understand its a syntax error.
Parse error: syntax error, unexpected T_FUNCTION in D:\Hosting\4587454\html\send_form_email.php on line 11
Code:
$email_subject = "New Weinsureusa Form";
$email_from = "daslian@yahoo.com";
$email_body = "You have received a new message from the user $name.\n".
"Here is the message:\n $message".
function died($error) {
echo "We are very sorry, but there were error(s) found with the form your submitted. ";
echo "These errors appear below.<br><br>";
echo $error."<br><br>";
echo "Please go back and fix these errors.<br><br>";
die();
}
Line 11 is: function died($error) {
Hopefully whatever this is will solve my problem.
|
|
|
|
09-27-2009, 01:58 PM
|
Re: Can't get form to show up at email address.
|
Posts: 744
Name: Mattias Nordahl
Location: Sweden
|
In the last section of code you posted you missed a semi colon (  at the row before the error. This is very common, always check the line before the one that gives you errors.
It seems you are running this site from you local computer, correct? If so, do you evan have a mail server installed?
__________________
34343639363436653237373432303635373837303635363337 34323037343638363137343263323036343639363432303739 366637353366
|
|
|
|
|
« Reply to Can't get form to show up at email address.
|
|
|
| Thread Tools |
Search this Thread |
|
|
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
|