Jump to content

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

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.