bigjohnsta
New Member
- Messages
- 3
- Reaction score
- 0
- Points
- 0
Alright so here's my site:
http://jchambo.pcriot.com/
For some reason the Email Contact Form at the bottom isn't working, even though it routs itself to the success page when you click "submit"
Anyone know how to fix this so after someone fills out the form the person's info goes to my email?
HELP PLEASE!
EDIT: Sorry here's the code i'm using:
INDEX.HTM FILE:
CONTACT.PHP FILE:
http://jchambo.pcriot.com/
For some reason the Email Contact Form at the bottom isn't working, even though it routs itself to the success page when you click "submit"
Anyone know how to fix this so after someone fills out the form the person's info goes to my email?
HELP PLEASE!
EDIT: Sorry here's the code i'm using:
INDEX.HTM FILE:
<form method="POST" action="contact.php">
<table width="677" height="172" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td width="244" height="10">
<p class="style12">Email From:<span class="style4 style19">*</span><br>
<input type="text" name="EmailFrom">
</td>
<td width="369"><p class="style12 style1">Company:<br>
<input type="text" name="Company"></td>
</tr>
<tr>
<td height="10"><p class="style12">Subject: <br>
<input type="text" name="Subject"></td>
<td height="10"><p class="style12 style1">Website:<br>
<input type="text" name="Website"></td>
</tr>
<tr>
<td height="99"><p class="style12 style1">Name:<br>
<input type="text" name="Name">
<table width="244" height="80" border="0" cellpadding="0" cellspacing="0">
<tr>
<td> </td>
</tr>
</table>
</td>
<td><p class="style12 style1">Message:<br>
<textarea name="Message" cols="50"></textarea>
<p><span class="style12 style1">
<input type="submit" name="submit" value="Send Message">
</span>
<span class="style12 style1 style2 style13">Fields marked <span class="style18">(*)</span> are required</span></td>
</tr>
</table></form>
CONTACT.PHP FILE:
<?php
// Website Contact Form Generator
// http://www.tele-pro.co.uk/scripts/contact_form/
// This script is free to use as long as you
// retain the credit link
// get posted data into local variables
$EmailFrom = Trim(stripslashes($_POST['EmailFrom']));
$EmailTo = "bigjohn-sta@comcast.net";
$Subject = Trim(stripslashes($_POST['Subject']));
$Name = Trim(stripslashes($_POST['Name']));
$Company = Trim(stripslashes($_POST['Company']));
$Website = Trim(stripslashes($_POST['Website']));
$Message = Trim(stripslashes($_POST['Message']));
// validation
$validationOK=true;
if (Trim($EmailFrom)=="") $validationOK=false;
if (!$validationOK) {
print "<meta http-equiv=\"refresh\" content=\"0;URL=error.htm\">";
exit;
}
// prepare email body text
$Body = "";
$Body .= "Name: ";
$Body .= $Name;
$Body .= "\n";
$Body .= "Company: ";
$Body .= $Company;
$Body .= "\n";
$Body .= "Website: ";
$Body .= $Website;
$Body .= "\n";
$Body .= "Message: ";
$Body .= $Message;
$Body .= "\n";
// send email
$success = mail($EmailTo, $Subject, $Body, "From: <$EmailFrom>");
// redirect to success page
if ($success){
print "<meta http-equiv=\"refresh\" content=\"0;URL=ok.htm\">";
}
else{
print "<meta http-equiv=\"refresh\" content=\"0;URL=error.htm\">";
}
?>
Last edited: