Jump to content

Getting custom contact form to work. Message not coming to my email.


Recommended Posts

Hey everyone. I'm having problems with a php contact form. I get the "thank you" message after I click submit, but its not coming to the email address I entered. Here is the live example.

 

http://chrisjenkinsinc.com/sampleworkplease.php

 

Thanks in advanced!

 

 

 

<!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=iso-8859-1" />

<title>Untitled Document</title>

</head>

 

<body><!-- Created with <STRONG><CONTACT> -->

<!-- http://www.stronghtml.com/ -->

 

<?php

if (isset($_POST['contactformvar3'])) $contactformvar3=trim($_POST['contactformvar3']); else $contactformvar3="";

if (isset($_POST['contactformvar4'])) $contactformvar4=trim($_POST['contactformvar4']); else $contactformvar4="";

if (isset($_POST['contactformvar5'])) $contactformvar5=trim($_POST['contactformvar5']); else $contactformvar5="";

if (isset($_POST['contactformvar6'])) $contactformvar6=trim($_POST['contactformvar6']); else $contactformvar6="";

if (isset($_POST['contactformvar7'])) $contactformvar7=trim($_POST['contactformvar7']); else $contactformvar7="";

if (isset($_POST['contactformvar8'])) $contactformvar8=trim($_POST['contactformvar8']); else $contactformvar8="";

if (isset($_POST['contactformvar9'])) $contactformvar9=trim($_POST['contactformvar9']); else $contactformvar9="";

if (isset($_POST['contactformvar10'])) $contactformvar10=trim($_POST['contactformvar10']); else $contactformvar10="";

if (isset($_POST['contactformvar11'])) $contactformvar11=trim($_POST['contactformvar11']); else $contactformvar11="";

if (isset($_POST['contactformvar12'])) $contactformvar12=trim($_POST['contactformvar12']); else $contactformvar12="";

if (isset($_POST['contactformvar13'])) $contactformvar13=trim($_POST['contactformvar13']); else $contactformvar13="";

if (isset($_POST['contactformvar14'])) $contactformvar14=trim($_POST['contactformvar14']); else $contactformvar14="";

if (isset($_POST['contactformvar15'])) $contactformvar15=trim($_POST['contactformvar15']); else $contactformvar15="";

if (isset($_POST['contactformvar16'])) $contactformvar16=trim($_POST['contactformvar16']); else $contactformvar16="";

if (isset($_POST['contactformvar17'])) $contactformvar17=trim($_POST['contactformvar17']); else $contactformvar17="";

if (isset($_POST['contactformvar18'])) $contactformvar18=trim($_POST['contactformvar18']); else $contactformvar18="";

if (isset($_POST['contactformvar19'])) $contactformvar19=trim($_POST['contactformvar19']); else $contactformvar19="";

if (isset($_POST['contactformvar20'])) $contactformvar20=trim($_POST['contactformvar20']); else $contactformvar20="";

if (isset($_POST['contactformvar21'])) $contactformvar21=trim($_POST['contactformvar21']); else $contactformvar21="";

if (isset($_POST['contactformvar22'])) $contactformvar22=trim($_POST['contactformvar22']); else $contactformvar22="";

if (isset($_POST['contactformvar23'])) $contactformvar23="CHECKED"; else $contactformvar23="";

if (isset($_POST['contactformvar24'])) $contactformvar24=trim($_POST['contactformvar24']); else $contactformvar24="";

if (isset($_POST['contactformvar25'])) $contactformvar25=trim($_POST['contactformvar25']); else $contactformvar25="";

if (isset($_POST['contactformvar26'])) $contactformvar26=$_POST['contactformvar26']; else $contactformvar26="";

if (isset($_POST['contactformvar27'])) $contactformvar27="CHECKED"; else $contactformvar27="";

if (isset($_POST['contactformvar28'])) $contactformvar28=trim($_POST['contactformvar28']); else $contactformvar28="";

if (isset($_POST['contactformvar29'])) $contactformvar29="CHECKED"; else $contactformvar29="";

if (isset($_POST['contactformvar30'])) $contactformvar30="CHECKED"; else $contactformvar30="";

if (isset($_POST['contactformvar31'])) $contactformvar31="CHECKED"; else $contactformvar31="";

if (isset($_POST['contactformvar32'])) $contactformvar32="CHECKED"; else $contactformvar32="";

if (isset($_POST['contactformvar33'])) $contactformvar33="CHECKED"; else $contactformvar33="";

if (isset($_POST['contactformvar34'])) $contactformvar34="CHECKED"; else $contactformvar34="";

if (isset($_POST['contactformvar35'])) $contactformvar35="CHECKED"; else $contactformvar35="";

if (isset($_POST['contactformvar36'])) $contactformvar36="CHECKED"; else $contactformvar36="";

if (isset($_POST['contactformvar37'])) $contactformvar37="CHECKED"; else $contactformvar37="";

if (isset($_POST['contactformvar38'])) $contactformvar38="CHECKED"; else $contactformvar38="";

if (isset($_POST['contactformvar39'])) $contactformvar39=$_POST['contactformvar39']; else $contactformvar39="";

if (isset($_POST['contactformseen'])) $contactformseen="y"; else $contactformseen="n";

$contactformform='

<form name="contactform" method="post" action="">

<input type="hidden" name="contactformseen" value="y">

<table border="0" cellspacing="0" cellpadding="0">

<tr>

<td align="right" valign="middle" class="contactformLeftColumn">Date</td>

<td align="left" class="contactformRightColumn"><input name="contactformvar3" id="contactformvar3" type="text" class="contactformTextField" value="'.$contactformvar3.'"></td>

</tr>

<tr>

<td align="right" valign="middle" class="contactformLeftColumn">Full Name</td>

<td align="left" class="contactformRightColumn"><input name="contactformvar4" id="contactformvar4" type="text" class="contactformTextField" value="'.$contactformvar4.'"></td>

</tr>

<tr>

<td align="right" valign="middle" class="contactformLeftColumn">Maiden Name</td>

<td align="left" class="contactformRightColumn"><input name="contactformvar5" id="contactformvar5" type="text" class="contactformTextField" value="'.$contactformvar5.'"></td>

</tr>

<tr>

<td align="right" valign="middle" class="contactformLeftColumn">Address</td>

<td align="left" class="contactformRightColumn"><input name="contactformvar6" id="contactformvar6" type="text" class="contactformTextField" value="'.$contactformvar6.'"></td>

</tr>

<tr>

<td align="right" valign="middle" class="contactformLeftColumn">City</td>

<td align="left" class="contactformRightColumn"><input name="contactformvar7" id="contactformvar7" type="text" class="contactformTextField" value="'.$contactformvar7.'"></td>

</tr>

<tr>

<td align="right" valign="middle" class="contactformLeftColumn">State</td>

<td align="left" class="contactformRightColumn"><input name="contactformvar8" id="contactformvar8" type="text" class="contactformTextField" value="'.$contactformvar8.'"></td>

</tr>

<tr>

<td align="right" valign="middle" class="contactformLeftColumn">Zip</td>

<td align="left" class="contactformRightColumn"><input name="contactformvar9" id="contactformvar9" type="text" class="contactformTextField" value="'.$contactformvar9.'"></td>

</tr>

<tr>

<td align="right" valign="middle" class="contactformLeftColumn">Home Phone</td>

<td align="left" class="contactformRightColumn"><input name="contactformvar10" id="contactformvar10" type="text" class="contactformTextField" value="'.$contactformvar10.'"></td>

</tr>

<tr>

<td align="right" valign="middle" class="contactformLeftColumn">Cell</td>

<td align="left" class="contactformRightColumn"><input name="contactformvar11" id="contactformvar11" type="text" class="contactformTextField" value="'.$contactformvar11.'"></td>

</tr>

<tr>

<td align="right" valign="middle" class="contactformLeftColumn">Email</td>

<td align="left" class="contactformRightColumn"><input name="contactformvar12" id="contactformvar12" type="text" class="contactformTextField" value="'.$contactformvar12.'"></td>

</tr>

<tr>

<td align="right" valign="middle" class="contactformLeftColumn">County you live in</td>

<td align="left" class="contactformRightColumn"><input name="contactformvar13" id="contactformvar13" type="text" class="contactformTextField" value="'.$contactformvar13.'"></td>

</tr>

<tr>

<td align="right" valign="middle" class="contactformLeftColumn">DOB</td>

<td align="left" class="contactformRightColumn"><input name="contactformvar14" id="contactformvar14" type="text" class="contactformTextField" value="'.$contactformvar14.'"></td>

</tr>

<tr>

<td align="right" valign="middle" class="contactformLeftColumn">SSN</td>

<td align="left" class="contactformRightColumn"><input name="contactformvar15" id="contactformvar15" type="text" class="contactformTextField" value="'.$contactformvar15.'"></td>

</tr>

<tr>

<td align="right" valign="middle" class="contactformLeftColumn">License #</td>

<td align="left" class="contactformRightColumn"><input name="contactformvar16" id="contactformvar16" type="text" class="contactformTextField" value="'.$contactformvar16.'"></td>

</tr>

<tr>

<td align="right" valign="middle" class="contactformLeftColumn">State Issued</td>

<td align="left" class="contactformRightColumn"><input name="contactformvar17" id="contactformvar17" type="text" class="contactformTextField" value="'.$contactformvar17.'"></td>

</tr>

<tr>

<td align="right" valign="middle" class="contactformLeftColumn">Make Model and Year of Vehicle</td>

<td align="left" class="contactformRightColumn"><input name="contactformvar18" id="contactformvar18" type="text" class="contactformTextField" value="'.$contactformvar18.'"></td>

</tr>

<tr>

<td align="right" valign="middle" class="contactformLeftColumn">Color 2 or 4 doors</td>

<td align="left" class="contactformRightColumn"><input name="contactformvar19" id="contactformvar19" type="text" class="contactformTextField" value="'.$contactformvar19.'"></td>

</tr>

<tr>

<td align="right" valign="middle" class="contactformLeftColumn">License Plate Number</td>

<td align="left" class="contactformRightColumn"><input name="contactformvar20" id="contactformvar20" type="text" class="contactformTextField" value="'.$contactformvar20.'"></td>

</tr>

<tr>

<td align="right" valign="middle" class="contactformLeftColumn">Do you have any children?</td>

<td align="left" class="contactformRightColumn"><input name="contactformvar21" id="contactformvar21" type="text" class="contactformTextField" value="'.$contactformvar21.'"></td>

</tr>

<tr>

<td align="right" valign="middle" class="contactformLeftColumn">If so, who will watch them for you?</td>

<td align="left" class="contactformRightColumn"><input name="contactformvar22" id="contactformvar22" type="text" class="contactformTextField" value="'.$contactformvar22.'"></td>

</tr>

<tr>

<td align="right" class="contactformLeftColumn"><input name="contactformvar23" id="contactformvar23" type="checkbox" class="contactformCheckBox" '.$contactformvar23.'></td>

<td align="left" valign="middle" class="contactformRightColumn"><label for="contactformvar23">Have you ever been arrested?</label></td>

</tr>

<tr>

<td align="right" valign="middle" class="contactformLeftColumn">If so, explain why.</td>

<td align="left" class="contactformRightColumn"><input name="contactformvar24" id="contactformvar24" type="text" class="contactformTextField" value="'.$contactformvar24.'"></td>

</tr>

<tr>

<td align="right" valign="middle" class="contactformLeftColumn">How is your general health?</td>

<td align="left" class="contactformRightColumn"><input name="contactformvar25" id="contactformvar25" type="text" class="contactformTextField" value="'.$contactformvar25.'"></td>

</tr>

<tr>

<td align="right" valign="top" class="contactformLeftColumn">Do you have any physical limitations?</td>

<td align="left" class="contactformRightColumn"><textarea name="contactformvar26" id="contactformvar26" class="contactformTextArea">'.$contactformvar26.'</textarea></td>

</tr>

<tr>

<td align="right" class="contactformLeftColumn"><input name="contactformvar27" id="contactformvar27" type="checkbox" class="contactformCheckBox" '.$contactformvar27.'></td>

<td align="left" valign="middle" class="contactformRightColumn"><label for="contactformvar27">Do you take any medications?</label></td>

</tr>

<tr>

<td align="right" valign="middle" class="contactformLeftColumn">If so, for what?</td>

<td align="left" class="contactformRightColumn"><input name="contactformvar28" id="contactformvar28" type="text" class="contactformTextField" value="'.$contactformvar28.'"></td>

</tr>

<tr>

<td align="right" class="contactformLeftColumn"><input name="contactformvar29" id="contactformvar29" type="checkbox" class="contactformCheckBox" '.$contactformvar29.'></td>

<td align="left" valign="middle" class="contactformRightColumn"><label for="contactformvar29">Do you smoke?</label></td>

</tr>

<tr>

<td align="right" class="contactformLeftColumn"><input name="contactformvar30" id="contactformvar30" type="checkbox" class="contactformCheckBox" '.$contactformvar30.'></td>

<td align="left" valign="middle" class="contactformRightColumn"><label for="contactformvar30">Do you do any illegal drugs?</label></td>

</tr>

<tr>

<td align="right" class="contactformLeftColumn"><input name="contactformvar31" id="contactformvar31" type="checkbox" class="contactformCheckBox" '.$contactformvar31.'></td>

<td align="left" valign="middle" class="contactformRightColumn"><label for="contactformvar31">Infants</label></td>

</tr>

<tr>

<td align="right" class="contactformLeftColumn"><input name="contactformvar32" id="contactformvar32" type="checkbox" class="contactformCheckBox" '.$contactformvar32.'></td>

<td align="left" valign="middle" class="contactformRightColumn"><label for="contactformvar32">Toddlers</label></td>

</tr>

<tr>

<td align="right" class="contactformLeftColumn"><input name="contactformvar33" id="contactformvar33" type="checkbox" class="contactformCheckBox" '.$contactformvar33.'></td>

<td align="left" valign="middle" class="contactformRightColumn"><label for="contactformvar33">2-5 Year olds</label></td>

</tr>

<tr>

<td align="right" class="contactformLeftColumn"><input name="contactformvar34" id="contactformvar34" type="checkbox" class="contactformCheckBox" '.$contactformvar34.'></td>

<td align="left" valign="middle" class="contactformRightColumn"><label for="contactformvar34">5-10 Year olds</label></td>

</tr>

<tr>

<td align="right" class="contactformLeftColumn"><input name="contactformvar35" id="contactformvar35" type="checkbox" class="contactformCheckBox" '.$contactformvar35.'></td>

<td align="left" valign="middle" class="contactformRightColumn"><label for="contactformvar35">Preteens</label></td>

</tr>

<tr>

<td align="right" class="contactformLeftColumn"><input name="contactformvar36" id="contactformvar36" type="checkbox" class="contactformCheckBox" '.$contactformvar36.'></td>

<td align="left" valign="middle" class="contactformRightColumn"><label for="contactformvar36">Teens</label></td>

</tr>

<tr>

<td align="right" class="contactformLeftColumn"><input name="contactformvar37" id="contactformvar37" type="checkbox" class="contactformCheckBox" '.$contactformvar37.'></td>

<td align="left" valign="middle" class="contactformRightColumn"><label for="contactformvar37">Seniors</label></td>

</tr>

<tr>

<td align="right" class="contactformLeftColumn"><input name="contactformvar38" id="contactformvar38" type="checkbox" class="contactformCheckBox" '.$contactformvar38.'></td>

<td align="left" valign="middle" class="contactformRightColumn"><label for="contactformvar38">Pets</label></td>

</tr>

<tr>

<td align="right" valign="top" class="contactformLeftColumn">Please explain the type of work that most interests y ou and that best suits your abilities. </td>

<td align="left" class="contactformRightColumn"><textarea name="contactformvar39" id="contactformvar39" class="contactformTextArea">'.$contactformvar39.'</textarea></td>

</tr>

<tr>

<td colspan="2" align="center"><input type="submit" name="Submit" value="Submit" class="contactformSubmit"></td>

</tr>

</table>

</form>';

if($contactformseen!="y") {

print "$contactformform";

} else {

$errstr="";

if ($errstr!='') {

print '<div align="center" class="contactformErrors">';

print $errstr;

print '</div>';

print $contactformform;

} else {

if (isSet($_SERVER)) {

if (isSet($_SERVER['HTTP_X_FORWARDED_FOR'])) {

$realip = $_SERVER['HTTP_X_FORWARDED_FOR'];

} elseif (isSet($_SERVER['HTTP_CLIENT_IP'])) {

$realip = $_SERVER['HTTP_CLIENT_IP'];

} else {

$realip = $_SERVER['REMOTE_ADDR'];

}

} else {

if ( getenv( 'HTTP_X_FORWARDED_FOR' ) ) {

$realip = getenv( 'HTTP_X_FORWARDED_FOR' );

} elseif ( getenv( 'HTTP_CLIENT_IP' ) ) {

$realip = getenv( 'HTTP_CLIENT_IP' );

} else {

$realip = getenv( 'REMOTE_ADDR' );

}

}

$host = @gethostbyaddr($realip);

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

$sendmessage = "--------------------\n";

$sendmessage.= " - Date: $contactformvar3\n";

$sendmessage.= " - Full Name: $contactformvar4\n";

$sendmessage.= " - Maiden Name: $contactformvar5\n";

$sendmessage.= " - Address: $contactformvar6\n";

$sendmessage.= " - City: $contactformvar7\n";

$sendmessage.= " - State: $contactformvar8\n";

$sendmessage.= " - Zip: $contactformvar9\n";

$sendmessage.= " - Home Phone: $contactformvar10\n";

$sendmessage.= " - Cell: $contactformvar11\n";

$sendmessage.= " - Email: $contactformvar12\n";

$sendmessage.= " - County you live in: $contactformvar13\n";

$sendmessage.= " - DOB: $contactformvar14\n";

$sendmessage.= " - SSN: $contactformvar15\n";

$sendmessage.= " - License #: $contactformvar16\n";

$sendmessage.= " - State Issued: $contactformvar17\n";

$sendmessage.= " - Make Model and Year of Vehicle: $contactformvar18\n";

$sendmessage.= " - Color 2 or 4 doors: $contactformvar19\n";

$sendmessage.= " - License Plate Number: $contactformvar20\n";

$sendmessage.= " - Do you have any children?: $contactformvar21\n";

$sendmessage.= " - If so, who will watch them for you?: $contactformvar22\n";

$sendmessage.= " - Have you ever been arrested?: $contactformvar23\n";

$sendmessage.= " - If so, explain why.: $contactformvar24\n";

$sendmessage.= " - How is your general health?: $contactformvar25\n";

$sendmessage.= " - Do you have any physical limitations?:\n$contactformvar26\n";

$sendmessage.= " - Do you take any medications?: $contactformvar27\n";

$sendmessage.= " - If so, for what?: $contactformvar28\n";

$sendmessage.= " - Do you smoke?: $contactformvar29\n";

$sendmessage.= " - Do you do any illegal drugs?: $contactformvar30\n";

$sendmessage.= " - Infants: $contactformvar31\n";

$sendmessage.= " - Toddlers: $contactformvar32\n";

$sendmessage.= " - 2-5 Year olds: $contactformvar33\n";

$sendmessage.= " - 5-10 Year olds: $contactformvar34\n";

$sendmessage.= " - Preteens: $contactformvar35\n";

$sendmessage.= " - Teens: $contactformvar36\n";

$sendmessage.= " - Seniors: $contactformvar37\n";

$sendmessage.= " - Pets: $contactformvar38\n";

$sendmessage.= " - Please explain the type of work that most interests y ou and that best suits your abilities. :\n$contactformvar39\n";

$sendmessage.= "--------------------\n";

$sendmessage.= "\n\nIP: $realip\n";

$sendmessage.= "HOST: $host\n\n";

$sendmessage.= "Date and time sent: $today";

 

@mail("Chrisj900@hotmail.com", "customer", $sendmessage, "From:  <>\r\nReply-To: \r\nX-Sender: Strong CONTACT (http://www.stronghtml.com)\r\nReturn-Path: <>");

print '

<table width="100%" border="0" cellspacing="0" cellpadding="10">

<tr>

<td align="center" class="contactformThankYou">

thanksssss

</td></tr></table>';

}

}

 

?>

 

 

</body>

 

</html>

 

</quote>

That is the craziest form I have ever seen, lol.  I would just chop it down to one variable first and see if I could get the email with something simple.  Then, start letting more code in, and you might catch the problem.

Hey guys, thanks for the reply. I'm trying to make a contact form with about 20 questions. Ive tried this site http://www.tele-pro.co.uk/scripts/contact_form/ and it does not work. It will display about 15 questions, and for the other 5 it wont have the boxes inserted.

 

Does anyone know of any contact form generators that work? 

 

 

Thanks in advanced, and I'll take out the @ to see if that fixes the problem.

 

EDIT** Taking out the @ symbol didn't work.

 

 

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.