PHP E-Mail Form Code
Moderator: General Moderators
Re: PHP E-Mail Form Code
Doesn't make any sense to me that var_dump wouldn't display any output.
Re: PHP E-Mail Form Code
This link http://0349433.netsolhost.com/dates.html has the form with the var_dump inserted in code below.
Code: Select all
<?php
/* Subject and E-Mail Variables */
$emailSubject = 'Date and Location Request';
$webMaster = 'mdd1127@yahoo.com';
/* Gather Data Variables */
$studentsnameField = $_POST['studentsname'];
$parentsnameField = $_POST['parentsname'];
$locationField = $_POST['location'];
$highschoolField = $_POST['highschool'];
$hearField = $_POST['hear'];
$dayphoneField = $_POST['dayphone'];
$eveningphoneField = $_POST['eveningphone'];
$emailField = $_POST['email'];
$body = <<<EOD
<br><hr><br>
Students Name: $studentsname <br>
Parents Name: $parentsname <br>
City / State: $location <br>
Nearest High School: $highschool <br>
How did you hear about the Workshops?: $hear <br>
Daytime Phone: $dayphone <br>
Evening Phone: $eveningphone <br>
E-Mail: $email <br>
EOD;
$headers = "From: $email\r\n";
$headers .= "Content-type: text/html\r\n";
$success = mail($webMaster, $emailSubject, $body, $headers);
var_dump($success);
/* Results rendered as html */
$theResults = <<<EOD
<html>Code removed for easier viewing</html>
EOD;
echo "$theResults";
?>
Last edited by Benjamin on Wed Sep 28, 2011 6:07 pm, edited 1 time in total.
Reason: Added [syntax=php|sql|css|javascript] and/or [text] tags.
Reason: Added [syntax=php|sql|css|javascript] and/or [text] tags.
Re: PHP E-Mail Form Code
View source after the form has been submitted. Very first line is bool(true). mail function completed successfully, meaning the problem is with your mail server.
Re: PHP E-Mail Form Code
So everything looks to be working okay. I will check with Network Solutions to see if they can help resolve the issue. Thanks for all of your help.