My PHP page is blank in Safari

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
lhenderson
Forum Newbie
Posts: 2
Joined: Wed Sep 16, 2009 10:02 pm

My PHP page is blank in Safari

Post 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
User avatar
Mirge
Forum Contributor
Posts: 298
Joined: Thu Sep 03, 2009 11:39 pm

Re: My PHP page is blank in Safari

Post by Mirge »

post contents of mailer.php please... using

Code: Select all

tags.
lhenderson
Forum Newbie
Posts: 2
Joined: Wed Sep 16, 2009 10:02 pm

Re: My PHP page is blank in Safari

Post 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>";
}
}

?>
User avatar
jackpf
DevNet Resident
Posts: 2119
Joined: Sun Feb 15, 2009 7:22 pm
Location: Ipswich, UK

Re: My PHP page is blank in Safari

Post by jackpf »

um
... using

Code: Select all

tags[/quote]
Eric!
DevNet Resident
Posts: 1146
Joined: Sun Jun 14, 2009 3:13 pm

Re: My PHP page is blank in Safari

Post 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.
Post Reply