Go Back   Computer Forums > Web Design | Website Development > Web Programming
Click Here to Login
Join Computer forums Today


Reply
 
Thread Tools Search this Thread Display Modes
 
Old 05-14-2010, 07:06 PM   #1
In Runtime
 
hockeygoalie5's Avatar
 
Join Date: Dec 2009
Location: United States
Posts: 297
Default PHP Mail

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>&nbsp;</td>
<td>&nbsp;</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>';
 }
?>
__________________

hockeygoalie5 is offline   Reply With Quote
Old 05-27-2010, 01:30 AM   #2
Solid State Member
 
Join Date: May 2010
Posts: 8
Default Re: PHP Mail

Try adding a Subject Variable

$subject = 'email subject';
N402KC is offline   Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off



All times are GMT -5. The time now is 02:09 PM.


Powered by vBulletin® Version 3.8.8 Beta 4
Copyright ©2000 - 2017, vBulletin Solutions, Inc.
Search Engine Friendly URLs by vBSEO 3.6.0