Page 1 of 1

My PHP page is blank in Safari

Posted: Wed Sep 16, 2009 10:05 pm
by lhenderson
So I'm using a PHP script to send an email and it's working fine in Firefox, but in Safari after the user inputs their information it just takes them to a blank php page. Why won't my script show in Safari? Here's the link to the php file: http://www.fuelcafedenver.com/mailer.php
here is the link to the homepage that links to the php file: http://www.fuelcafedenver.com

Re: My PHP page is blank in Safari

Posted: Wed Sep 16, 2009 10:31 pm
by Mirge
post contents of mailer.php please... using

Code: Select all

tags.

Re: My PHP page is blank in Safari

Posted: Thu Sep 17, 2009 9:58 am
by lhenderson
Here is the php script that runs on the page. Works fine in Firefox, is a blank page in Safari.


<?php

//Some variables
$mymail = "bob@fuelcafedenver.com";
$ename = $_POST['ename'];
$eemail = $_POST['eemail'];
$emessage = $_POST['emessage'];

//Function to check email address
function checkemail($eemail) {
if(eregi("^[0-9a-z]([-_.]?[0-9a-z])*@[0-9a-z]([-.]?[0-9a-z])*\\.[a-z]{2,4}$",$eemail)) {
return true;
}
else {
return false;
}
}

//Mail Processing
if ($_POST['submitted']) {
//Check for blank fields
if ($ename == "" || $eemail == "") {
echo "<p>It appears that you left a blank field.<br/> Please make sure you fill everything in.</p>";
}
//Check to see if the email address is valid
else if (checkemail($eemail) == false) {
echo "<p>It appears that you enter an invalid email address.<br/> Please check your email again.</p>";
}
//Send the email if there's no error
else {
$body = "$emessage\n$ename\n$eemail";
$emailsubject = "Daily Lunch Special Sign Up";
mail($mymail,$body,$emailsubject,"From: $eemail\n");
echo "<p>Thank you for your email $ename!</p>";
}
}

?>

Re: My PHP page is blank in Safari

Posted: Thu Sep 17, 2009 10:00 am
by jackpf
um
... using

Code: Select all

tags[/quote]

Re: My PHP page is blank in Safari

Posted: Thu Sep 17, 2009 6:12 pm
by Eric!
What is safari returning for your $_POST data when you submit your email message to this script? Insert these lines in the top of the script to see.

Code: Select all

echo "Button Status:".$_POST['submitted']."<br />";//if this isn't set nothing will appear in your browser
echo "All Posted data:<br /><pre>".var_dump($_POST)."</pre>";
 
Compare to a working browser and maybe you'll find the problem.