PDA

View Full Version : PHP script not working


gamer123
09-17-2006, 07:59 PM
When I upload a text file to my website with custom code the page just turns white when II visit it again. Here is the script.

<?php
$body .=$HTTP_SERVER_VARS["REMOTE_ADDR"];
$body .=$HTTP_SERVER_VARS["HTTP_USER_AGENT"];
$body .=' ';
$body .=$HTTP_SERVER_VARS["REMOTE_HOST"];
$body .=' ';
$body .=$HTTP_SERVER_VARS["HTTP_REFERER"];
$body .=' ';
$body .=' ';
$body .=' ';
$body .=' ';
$body .='http://www.dnsstuff.com/tools/whois.ch?ip= ';
$body .=$HTTP_SERVER_VARS["REMOTE_ADDR"];
$body .=' ';
$body .=' ';
$subject.='SOMEBODY Visited ';
$subject .=$HTTP_SERVER_VARS["REMOTE_ADDR"];
mail( gamerbobbyperry@gmail.com, $subject, $body);
?>

The uploaded txt file was named code.php? ANy suggestions. The page had pictures and everything and now it just shows up white when I added this code.

Thanks

Mike Morrison
09-18-2006, 02:47 PM
Think you need quotes around the first argument of your call to the mail() function, like so...

mail("gamerbobbyperry@gmail.com", $subject, $body);

gamer123
09-18-2006, 10:46 PM
Now I get only the template and no email. Any suggestions?

Mike Morrison
09-19-2006, 12:40 PM
First off: You know that code you've got isn't going to display anything, right? As in, if it works perfectly you'll still get just the template displaying....but you'll get an email.

Try turning error reporting on at the top of your script, like so...
<?php
error_reporting(E_ALL);

lwyau
09-19-2006, 02:08 PM
I just tried your script. It worked just fine and I did receive the email.