Log in

View Full Version : PHP proccing Forum



Disney Maniac
11-19-2008, 03:47 AM
I have created a php file to process my web forum and for some reason, it does not want to work. Can anyone please help me? I am using Dreamweaver 8, if you need the html, please just ask and I will also post it. Thank you.
Here is the code:

<?php
/* Subject and email variables */

$emailSubject = 'Website Comments';
$webMaster = 'baysidemarc@msn.com';

/* Gathering Data Variables */

$nameField = $_POST['name'];
$emailField = $_POST['email'];
$commentsField = $_POST['comments'];

$body = <<<EOD
<br><hr><br>
Name: $name <br>
Email: $email <br>
Comments: $comments <br>
EOD;

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

/* Results rendered as HTML */

$theResults = <<<EOD
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />
<title>Thank you</title>
<style type="text/css">
<!--
body {
background-image: url();
background-color: #0066FF;
}
.style2 {font-family: "Walt Disney Script v4.1"; font-size: 36pt; color: #3333CC; }
.style28 {
font-size: 12pt;
font-family: Verdana, Arial, Helvetica, sans-serif;
color: #000000;
}
-->
</style>
<style type="text/css">
<!--
.style31 {color: #0000FF}
-->
</style>
</head>
<body>

<h1>Thank you for your Email, it will be replyed to very shortly!</h1>
</div>
</body>
</html>
EOD;
echo "$theResults";
?>

boogyman
11-19-2008, 02:02 PM
does your host support PHP on the server you are using?

BLiZZaRD
11-19-2008, 02:42 PM
I love the old "it doesn't work" posts. I always picture a white page on the screen with a little gremlin sitting there arms crossed and pouting saying "I ain't working today, no sir!"

Ahh, it cracks me up.. here is my code, you figure out what it is supposed to do, what it isn't doing and the errors I am seeing on my monitor. hahahaha

Disney Maniac
11-19-2008, 07:17 PM
I love the old "it doesn't work" posts. I always picture a white page on the screen with a little gremlin sitting there arms crossed and pouting saying "I ain't working today, no sir!"

Ahh, it cracks me up.. here is my code, you figure out what it is supposed to do, what it isn't doing and the errors I am seeing on my monitor. hahahaha:mad:

Give me a break, I have only been coding for a year, I don't know what's wrong with me asking only one little question. And by the way, my server does support php.

prasanthmj
11-19-2008, 07:20 PM
The obvious errors on first look is that you have different variable names while composing the email
$name instead of $nameField in the email.

The following pages also might help:
get email from an HTML form submission (http://www.html-form-guide.com/email-form/html-email-form.html)

PHP Form to email explained (http://www.html-form-guide.com/email-form/php-form-to-email.html)

Disney Maniac
11-19-2008, 09:01 PM
Thanks for the help, but I still can't fix it.