PHP Mail

hockeygoalie5

In Runtime
Messages
299
Location
United States
I made this contact form, and it worked fine. All of a sudden it stopped collecting the info for the fields and I don't know why!

Code:
<?php

$subject = $_REQUEST['subject'];

$message = $_REQUEST['detail'];


$name = $_REQUEST['name'];
$mail_from = $_REQUEST['customer_mail'];

$headers = "from: $name <$mail_from>";


$to = 'contact@bitelogic.co.uk';

$send_contact = mail($to,$subject,$message,$headers);

if ($_GET['message_sent'] == true) {
echo "<html><script type=\"text/javascript\" src=\"js/ajax.js\"></script>
<script type=\"text/javascript\" src=\"js/ajax-dynamic-content.js\"></script>Thanks for contacting us, please give 24 hours for a reply.<br /><a href=\"javascript:ajax_loadContent('left', 'contact.php');\">Back to form</a>.</html>";
$subject = $_REQUEST['subject'];

$message = $_REQUEST['detail'];


$name = $_REQUEST['name'];
$mail_from = $_REQUEST['customer_mail'];

$headers = "from: $name <$mail_from>";


$to = 'contact@bitelogic.co.uk';

$send_contact = mail($to,$subject,$message,$headers);

mail($to,$subject,$message,$headers);
}
else {
echo '
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> 
<html lang="en" xmlns="http://www.w3.org/1999/xhtml" xml:lang="en"> 
  <head> 
    <meta http-equiv="content-type" content="text/html; charset=utf-8" /> 
    <link href="style.css" rel="stylesheet" type="text/css" /> 
    <title>Bitelogic | Contact</title> 
    <script type="text/javascript" src="js/ajax.js"></script>
<script type="text/javascript" src="js/ajax-dynamic-content.js"></script>
</head>
<body>
<div class="left-header">Contact us</div> 
<p><table width="400" border="0" align="center" cellpadding="3" cellspacing="1">
<tr>
</tr>
</table>
<table width="400" border="0" align="center" cellpadding="0" cellspacing="1">
<tr>
<td><form name="form1" method="post" action="javascript:ajax_loadContent(\'left\', \'contact.php?message_sent=true\');">
<table width="100%" border="0" cellspacing="1" cellpadding="3">
<tr>
<td width="16%">Subject</td>
<td width="2%">:</td>
<td width="82%"><input name="subject" type="text" id="subject" size="50"></td>
</tr>
<tr>
<td>Detail</td>
<td>:</td>
<td><textarea name="detail" cols="50" rows="4" id="detail"></textarea></td>
</tr>
<tr>
<td>Name</td>
<td>:</td>
<td><input name="name" type="text" id="name" size="50"></td>
</tr>
<tr>
<td>Email</td>
<td>:</td>
<td><input name="customer_mail" type="text" id="customer_mail" size="50"></td>
</tr>
<tr>
<td> </td>
<td> </td>
<td><input type="submit" name="Submit" value="Submit"> <input type="reset" name="Submit2" value="Reset"></td>
</tr>
</table>
</form>
</td>
</tr>
</table>
</p>
  </body> 
 </html>';
 }
?>
 
Back
Top Bottom