Page 2 of 2

Re: PHP E-Mail Form Code

Posted: Wed Sep 28, 2011 3:37 pm
by Celauran
Doesn't make any sense to me that var_dump wouldn't display any output.

Re: PHP E-Mail Form Code

Posted: Wed Sep 28, 2011 3:44 pm
by mdeppa
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";

?>

Re: PHP E-Mail Form Code

Posted: Wed Sep 28, 2011 3:47 pm
by Celauran
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

Posted: Wed Sep 28, 2011 4:31 pm
by mdeppa
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.