Viewing Help with Contact Us form - HTML

Help with Contact Us form - HTML



User: Guest 10 years ago
Hi...can someone help me with this code as it doesn't actually work? It's for a contact us form. It displays ok, but the email doesn't make it to my inbox at support@thetruthaboutdiets.net and after the message has been submitted it should take me back to the Thanks page of my website? That doesn't work either.

It has to use a PHP instead of a HTML and this is causing difficulties I have asked about this on a previous post. But when I clike on the navigation button in Easyweb to go to the contact us page it's a .HTML is there a way to change this to a .PHP.

If what I'm doing is really over complicated and there's an easier way please let me know as I'm a beginner!

Thanks
John

Code below.


switch (@$_GET['do'])
{

case "send":

$fname = $_POST['fname'];
$lname = $_POST['lname'];
$femail = $_POST['femail'];
$f2email = $_POST['f2email'];
$saddy = $_POST['saddy'];
$scity = $_POST['scity'];
$szip = $_POST['szip'];
$fphone1 = $_POST['fphone1'];

$mname = $_POST['mname'];
$sapt = $_POST['sapt'];
$sstate = $_POST['sstate'];
$scountry = $_POST['scountry'];
$fphone2 = $_POST['fphone2'];
$fphone3 = $_POST['fphone3'];
$fsendmail = $_POST['fsendmail'];
$secretinfo = $_POST['info'];

if (!preg_match("/\S+/",$fname))
{
unset($_GET['do']);
$message = "First Name required. Please try again.";
break;
}

{
unset($_GET['do']);
$message = "Primary Email Address is incorrect. Please try again.";
break;
}



if ($secretinfo == "")
{
$myemail = "support@thetruthaboutdiets.net";
$emess = "First Name: ".$fname."\n";

$emess.= "Email 1: ".$femail."\n";

$emess.= "Comments: ".$fsendmail;
$ehead = "From: ".$femail."
";
$subj = "An Email from ".$fname." ".$mname." ".$lname."!";
$mailsend=mail("$myemail","$subj","$emess","$ehead");
$message = "Email was sent.";
}

unset($_GET['do']);
header("Location: CONTACTFORM.html");
break;

default: break;
}
?>







if ($message) echo '

'.$message.'

';
?>




Name:






Email:








Comments:






Edit
User: Roddy 10 years ago
I answered your question here...

http://ragesw.net/easyweb-beta/viewtopic.php?f=6...t=791

It's a question of modifying the .htaccess file on your server to allow an HTML page to execute PHP.

You can also create the contact form with HTML and reference the PHP script(s) on the server like this...



-------------------------------
Roddy

Website: http://everwebwidgets.com
Contact: http://everwebwidgets.com/ewWidgets-home/contact.html
NOTE: I am an EverWeb user and NOT affiliated with EverWeb! Any opinions expressed in this forum are my own.
Set As Best Answer
User: Guest 10 years ago
I found this page and it works fine and it's really simple to use http://www.foxyform.com
Edit Set As Best Answer


Post Reply
You must login or signup to post.