For some reason I have this PHP form that I had put together which I thought was going to inbox which still is not. The form processes but every e-mail goes to the inbox. The only time it goes to the inbox is only if I’m launching it and testing the form through my PC. If somebody could help me fix this problem because this has been driving me stupid crazy. I had paid a local web company to put together the form and it seems it works but not sending to write location. This form is for my best friend / client website so that is why I sort of need it fixed ASAP. She’s starting to get pretty impatient so. I also have the HTML form code just below.
<?php
$where_form_is="http://".$_SERVER['SERVER_NAME'].strrev(strstr(strrev($_SERVER['PHP_SELF']),"/"));
session_start();
if( ($_SESSION['security_code']==$_POST['security_code']) && (!empty($_POST['security_code'])) ) {
if($_POST['subject']=='1')
{
$to="kevra83@gmail.com";
}
$to="kevra83@gmail.com";
$subject = 'Form Submission';
$message = "Visitor Message
First Name: " . $_POST['firstname'] ."\\r\
". "
Last Name: " . $_POST['lastname'] ."\\r\
". "
Phone Number: " . $_POST['phone'] ."\\r\
". "
Email Address: " . $_POST['email'] ."\\r\
". "
Comments.: " . $_POST['comment'] ."\\r\
". "
Sent to you by contact form.";
$headers = 'From: kevra83@gmail.com' . "\\r\
" .
'X-Mailer: PHP/' . phpversion();
mail($to, $subject, $message, $headers);
include("contact.html");
}
else {
echo "Invalid Captcha String, please resubmit form and type in the image.";
}
?>
<div id="left">
<div id="contact_form">
<h1>Contact </h1>
<p>Please fill out the information below.</p>
<form method="post" action="formm.php" name="Customer Service Form">
<input type="hidden" name="subject" value="Customer Service Inquiry">
<input type="hidden" name="redirect" value="../thankyou.php">
<table width="550" border="0" align="center" cellpadding="0" cellspacing="6" class="style10">
<tr>
<td colspan="2"><b>*Denotes required fields:</b> </td>
</tr>
<tr>
<td class="colorRed" colspan="2"></td>
</tr>
<tr>
<td colspan="2"> </td>
</tr>
<tr>
<td width="319" ><div align="right"><b>*</b> First Name: </div></td>
<td width="433" ><input type="text" maxlength="40" size="18" value="" name="firstname" id="firstname" /></td>
</tr>
<tr>
<td ><div align="right"><b>* </b>Last Name: </div></td>
<td ><input type="text" maxlength="40" size="18" value="" name="lastname" id="lastname" /></td>
</tr>
<tr>
<td ><div align="right"><b>* </b>Phone Number: </div></td>
<td ><input type="text" maxlength="10" size="10" value="" name="phone" id="phone" /></td>
</tr>
<tr>
<td ><div align="right"><b>* </b>Email Address: </div></td>
<td >
<input type="text" maxlength="100" size="18" value="" name="email" id="email" /> </td>
</tr>
<tr>
<td colspan="2"> </td>
</tr>
<tr>
<td><div align="right">Comments</div></td>
<td><textarea cols="50" rows="8" wrap="virtual" maxlength="1000" name="comment" id="comment"></textarea></td>
</tr>
<tr>
<td colspan="2"> </td>
</tr>
<tr class="bodywhite_text">
<td valign="top" class="bodytext3"><label class="formFieldQuestion">
<div align="right">Type the image* <a class="info" href="#"><img src="tip_small.png" alt="For security purposes, please type the letters in the image." border="0" /></a><br />
<img src="CaptchaSecurityImages.php" /> </div>
</label></td>
<td valign="top"><input id="captchaForm" name="security_code" class="mainForm" type="text"/></td>
</tr>
<tr>
<td ></td>
<td ><input name="Submit" type="submit" onclick="MM_validateForm('email','','RisEmail');return document.MM_returnValue" value="Submit" /></td>
</tr>
</table>
</form></div>
<div id="message_sent" style="display:none;">
<h1>Your message has been sent</h1>
<p>We'll contact you in a shortest possible time.</p>
<p>You can now <a href="#" class="read-more">go back</a> to home page.</p>
</div>
</div>