Jump to content

Contact Form


catz_art

Recommended Posts

Hello, My 1st inquiry. I have a simple contact form. My hosting account is through GoDaddy, a deluxe hosting account, the email is through gmail (wyan.org). The form comes through to my email account, but the variables do not post :( The subject does get sent through, but the email field is supposed to insert the email from the person who filled out the form, & it is defaulting to the Hosting account's primary user name. Please help me get my form working!

 

 

<?php

/* Subject & email variables */

$emailSubject = 'Request from website';
$webMaster = '[email protected]';

/*	Gathering Data Variables */

$strSubjectField = $_POST['strSubject'];
$NameField = $_POST['Name'];
$EmailField = $_POST['Email'];
$PhoneField = $_POST['Phone'];
$CommentsField = $_POST['Comments'];


$body = <<<EOD
<br><hr><br>
Subject: $strSubject<br>
Name: $Name <br>
Email: $Email <br>
Phone Number: $Phone <br>
Comments: $Comments <br>
EOD;

$headers = "From: $Email\r\n";
$headers .= "Content-type: text/html\r\n";
$success = mail($webMaster, $emailSubject, $body, $headers);


/* Results redered as HTML */

$theResults = <<<EOD
<html>
<head>
<title>Thank You! Pallottine Fathers</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style type="text/css">
<!--
body {
background-color: #033;
font-family: Arial, Verdana, Univers;
font-size: 14px;
font-style: normal;
line-height: normal;
font-weight: normal;
color: #FFF;
text-decoration: none;
}
-->
</style>
</head>

<div>
  <div align="left">Thank you for your interest! Your email will be answered very soon!</div>
</div>
</body>
</html>
EOD;
echo "$theResults";

?>

Link to comment
https://forums.phpfreaks.com/topic/240236-contact-form/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.