Join Login


 PHP FORM
 by jermaine - Nov 19, 2012

I followed the training video, and everything works ok, but the only problem is that i do not receive the email in my account.
why is this?

see code below
<?php
if ($_POST['parse_var'] == "prayerrequest") {

$emailTitle = 'Prayer Request';
$yourEmail = 'csr@worlddeliveranceministries.org';

$emailField = $_POST['email'];
$nameField = $_POST['name'];
$messagelField = $_POST['message'];

$body = <<<EOD
<br><hr><br>
Email: $emailField <br />
Name: $nameField <br />
Message: $messageField <br />

EOD;

$headers = "From: $emailField\r\n";
$headers .= "content-type: text/html\r\n";
$success = mail ("$yourEmail","$emailTitle","$body","$headers");

$sent = "THANK YOU! Your prayer has been sent.";
}


?>
<!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>Untitled Document</title>
<script type="text/javascript">
function MM_validateForm() { //v4.0
if (document.getElementById){
var i,p,q,nm,test,num,min,max,errors='',args=MM_validateForm.arguments;
for (i=0; i<(args.length-2); i+=3) { test=args[i+2]; val=document.getElementById(args[i]);
if (val) { nm=val.name; if ((val=val.value)!="") {
if (test.indexOf('isEmail')!=-1) { p=val.indexOf('@');
if (p<1 || p==(val.length-1)) errors+='- '+nm+' must contain an e-mail address.\n';
} else if (test!='R') { num = parseFloat(val);
if (isNaN(val)) errors+='- '+nm+' must contain a number.\n';
if (test.indexOf('inRange') != -1) { p=test.indexOf(':');
min=test.substring(8,p); max=test.substring(p+1);
if (num<min || max<num) errors+='- '+nm+' must contain a number between '+min+' and '+max+'.\n';
} } } else if (test.charAt(0) == 'R') errors += '- '+nm+' is required.\n'; }
} if (errors) alert('The following error(s) occurred:\n'+errors);
document.MM_returnValue = (errors == '');
} }
</script>
</head>

<body>
<p>&nbsp;</p>
<p align="center"><img src="../images/banner.jpg" width="968" height="200" /></p>
<table width="400" border="1" cellpadding="0" align="center">
<tr>
<th scope="col" align="center">Prayer Request <br /><br />
<form id="prayerrequest" name="prayerrequest" method="post" action="prayer_request.php">
<table width="100%" border="0" cellpadding="3">
<tr bgcolor="#cccccc">
<th width="19%" align="left"scope="col">Name</th>
<th width="81%" scope="col"><label for="name"></label>
<input name="name" type="text" id="name" onblur="MM_validateForm('name','','R','email','','RisEmail','message','','R');return document.MM_returnValue" size="30" maxlength="30" value="<?php print "$namefield"; ?>" /></td>
</tr>
<tr>
<td align="left">Email</td>
<td><label for="email"></label>
<input type="text" name="email" id="email" maxlength="50" size="50"value="<?php print "$emailfield"; ?>"/></td>
</tr>
<tr bgcolor="#cccccc">
<td align="left">Message</td>
<td><label for="message"></label>
<textarea name="message" id="message" cols="45" rows="5"><?php print "$messagefield"; ?></textarea></td>
</tr>
<tr>
<td>&nbsp;</td>
<td align="right"><input type="reset" name="reset" id="reset" value="Reset" />
<input type="hidden" name="parse_var" id="parse_var" value="prayerrequest" /> <input type="submit" name="Submit" id="Submit" value="Submit" /></td>
</tr>
<tr>
<td colspan="2"><?php print "$sent"; ?></td>
</tr>
</table>
</form></th>
</tr>
</table>
<p align="center"><img src="../images/footer.jpg" alt="footer" width="968" height="100" border="0" usemap="#Map" />
<map name="Map" id="Map">
<area shape="rect" coords="255,10,313,29" href="home.html" alt="home" />
<area shape="rect" coords="324,12,412,29" href="#" alt="about us" />
<area shape="rect" coords="429,10,547,29" href="Apostle Whyte.html" alt="The Leaders" />
<area shape="rect" coords="562,10,672,29" href="partnership.html" alt="Partnership" />
<area shape="rect" coords="688,10,760,26" href="automatic_billing.html" alt="automatic giving" />
<area shape="rect" coords="847,12,952,27" href="contact_us.html" alt="Contact Us" />
</map>
</p>
</body>
</html>


jermaine
Canada
Posts:1
Joined:Nov 19, 2012
  
Home About Contact Forum Youtube Privacy Policy
Copyright © 2009-2011 RiverCityGraphix.All Rights Reserved.