Contact form not posting...
Posted: Thu Sep 23, 2010 9:09 am
While I'll admit that I'm relatively new to php, I have looked at multiple tutorials for this form, and have even scripts the php file from scratch multiple times; all with the same effect.
Here's my problem: The send button will not send the email to my email address. Based on the tutorials I've read, it should; but it doesn't and I think I've tried everything I can think of.
Here's the form file
Here's the contactformprocess.php file. This version of the .php file is precoded directly from someone that knows what they're doing. I modified it to fit my id's but the form still doesn't seem to post.
[syntax]
<?php
/*
* @Web Contact Page PHP Script
* @author helpvid@ymail.com - http://www.helpvid.net
* @version 1.0.0
* @date January 05, 2010
* @category Helpvid PHP Script for Contact page
* @copyright (c) 2010 @helpvid.net (http://www.helpvid.net)
* @Creative Commons Attribution-No Derivative Works 2.0 UK: England & Wales License.
* @Creative Commons Attribution-No Derivative Works 2.5 UK: SCOTLAND License.
* @Creative Commons Attribution-No Derivative Works 3.0 United States License.
*/
/* Email Variables */
$emailSubject = 'contactformprocess!'; /*Make sure this matches the name of your file*/
$webMaster = "nightfall123@hotmail.com";
/*design by Mark Leroy @ http://www.helpvid.net*/
/* Data Variables */
$email = $_POST['email'];
$name = $_POST['name'];
$feedback = $_POST['feedback'];
$subject = $_POST['subject'];
$body = <<<EOD
<br><hr><br>
Name: $name <br>
Email: $email <br>
Subject: $subject <BR>
Message:<BR><BR> $feedback <br>
EOD;
$headers = "From: $email\r\n";
$headers .= "Content-type: text/html\r\n";
$success = mail($webMaster, $emailSubject, $body,
$headers);
/* Results rendered as HTML */
$theResults = <<<EOD
<html>
<head>
<title>sent message</title>
<meta http-equiv="refresh" content="3;URL=http://YOUR WEBSITE ADDRESS/contact.html">
<style type="text/css">
<!--
body {
background-color: #474747; /* You can edit this CSS to match your website*/
font-family: Verdana, Arial, Helvetica, sans-serif;
font-size: 20px;
font-style: normal;
line-height: normal;
font-weight: normal;
color: #FFC721;
text-decoration: none;
padding-top: 200px;
margin-left: 150px;
width: 800px;
}
-->
</style>
</head>
<div align="center">Your message has been successfully sent.</div>
</div>
</body>
</html>
EOD;
echo "$theResults";
?>
[/syntax]
Any help would be much appreciated.
Here's my problem: The send button will not send the email to my email address. Based on the tutorials I've read, it should; but it doesn't and I think I've tried everything I can think of.
Here's the form file
Code: Select all
<HTML>
<head>
<style type="text/css">
*{ margin:0; padding:0;}
body{ font:100% normal Arial, Helvetica, sans-serif; background:#161712;}
form,input,select,textarea{margin:0; padding:0; color:#ffffff;}
div.box {
margin:0 auto;
width:500px;
background:#222222;
position:relative;
top:5px;
border:1px solid #262626;
}
div.box h1 {
color:#FFC721;
font-size:18px;
text-transform:uppercase;
padding:5px 0 5px 5px;
border-bottom:1px solid #161712;
border-top:1px solid #161712;
}
div.box label {
width:100%;
display: block;
background:#1C1C1C;
border-top:1px solid #262626;
border-bottom:1px solid #161712;
padding:10px 0 10px 0;
}
div.box label span {
display: block;
color:#FFC721;
font-size:12px;
float:left;
width:100px;
text-align:right;
padding:5px 20px 0 0;
}
div.box .input_text {
padding:10px 10px;
width:200px;
background:#262626;
border-bottom: 1px double #171717;
border-top: 1px double #171717;
border-left:1px double #333333;
border-right:1px double #333333;
}
div.box .message{
padding:7px 7px;
width:350px;
background:#262626;
border-bottom: 1px double #171717;
border-top: 1px double #171717;
border-left:1px double #333333;
border-right:1px double #333333;
overflow:hidden;
height:150px;
}
div.box .button
{
margin:0 0 10px 0;
padding:4px 7px;
background:#FFC721;
border:0px;
position: relative;
top:10px;
left:382px;
width:100px;
border-bottom: 1px double yellow;
border-top: 1px double yellow;
border-left:1px double yellow;
border-right:1px double yellow;
color:#474747;
font-weight:700;
}
</style>
</head>
<body>
<form action="contactformprocess.php" method="POST">
<div class="box">
<h1>Contact Us :</h1>
<label>
<span>User/Company Name</span>
<input type="text" class="input_text" name="name" id="name"/>
</label>
<label>
<span>Email</span>
<input type="text" class="input_text" name="email" id="email"/>
</label>
<label>
<span>Subject</span>
<input type="text" class="input_text" name="subject" id="subject"/>
</label>
<label>
<span>Message</span>
<textarea class="message" name="feedback" id="feedback"></textarea>
<input type="button" class="button" value="Send" />
</label>
</div>
</form>
</body>
</HTML>
[syntax]
<?php
/*
* @Web Contact Page PHP Script
* @author helpvid@ymail.com - http://www.helpvid.net
* @version 1.0.0
* @date January 05, 2010
* @category Helpvid PHP Script for Contact page
* @copyright (c) 2010 @helpvid.net (http://www.helpvid.net)
* @Creative Commons Attribution-No Derivative Works 2.0 UK: England & Wales License.
* @Creative Commons Attribution-No Derivative Works 2.5 UK: SCOTLAND License.
* @Creative Commons Attribution-No Derivative Works 3.0 United States License.
*/
/* Email Variables */
$emailSubject = 'contactformprocess!'; /*Make sure this matches the name of your file*/
$webMaster = "nightfall123@hotmail.com";
/*design by Mark Leroy @ http://www.helpvid.net*/
/* Data Variables */
$email = $_POST['email'];
$name = $_POST['name'];
$feedback = $_POST['feedback'];
$subject = $_POST['subject'];
$body = <<<EOD
<br><hr><br>
Name: $name <br>
Email: $email <br>
Subject: $subject <BR>
Message:<BR><BR> $feedback <br>
EOD;
$headers = "From: $email\r\n";
$headers .= "Content-type: text/html\r\n";
$success = mail($webMaster, $emailSubject, $body,
$headers);
/* Results rendered as HTML */
$theResults = <<<EOD
<html>
<head>
<title>sent message</title>
<meta http-equiv="refresh" content="3;URL=http://YOUR WEBSITE ADDRESS/contact.html">
<style type="text/css">
<!--
body {
background-color: #474747; /* You can edit this CSS to match your website*/
font-family: Verdana, Arial, Helvetica, sans-serif;
font-size: 20px;
font-style: normal;
line-height: normal;
font-weight: normal;
color: #FFC721;
text-decoration: none;
padding-top: 200px;
margin-left: 150px;
width: 800px;
}
-->
</style>
</head>
<div align="center">Your message has been successfully sent.</div>
</div>
</body>
</html>
EOD;
echo "$theResults";
?>
[/syntax]
Any help would be much appreciated.