PHP 4.0 Bug #3305: Global vars and mail() unpredictability
| From: | joel at nextstudio dot com | Date: | Mon, 24 Jan 2000 22:38:39 +0000 |
| Subject: | PHP 4.0 Bug #3305: Global vars and mail() unpredictability | ||
| Groups: | php.dev | ||
| Request: | Send a blank email to php-dev+get-14891@lists.php.net to get a copy of this message | ||
From: joel@nextstudio.com
Operating system: Solaris 2.6
PHP version: 4.0 Beta 3
PHP Bug Type: Other
Bug description: Global vars and mail() unpredictability
$SERVER_NAME, $REQUEST_URI, and $QUERY_STRING aren't being echoed out in the email body. They
work fine in the from and reply-to headers, though.
Here's what i get in my email:
-- begin email snippet --
Date: Mon, 24 Jan 2000 14:25:08 -0800
Message-Id: <200001242225.OAA04055@unionbay.>
To: joel@nextstudio.com
Subject: Success
From: webmaster@unionbay.nexthost.com
Reply-To: webmaster@unionbay.nexthost.com
X-Mailer: PHP/4.0b3
Sender: nobody@unionbay.nexthost.com
Zip search database rebuilt.
Num of records: 8711
Monday, January 24, 2000 02:25:08 pm
HOST: , URI:
REMOTE_ADDR:
-- end email snippet
Below is the code that I used to generate the above response.
-- begin script snippet1 --
/*
* bool status_mail(bool end, string subj, string message, string recpt)
*
* email result status
*/
function status_mail($bomb, $subj, $msg, $recpt="joel@nextstudio.com") {
$r = mail($recpt, $subj, $msg."\n\n".date("l, F j, Y h:i:s a")."\n".
"HOST: ".$SERVER_NAME.", URI: ".$REQUEST_URI.$QUERY_STRING."\n".
"REMOTE_ADDR: ".$REMOTE_ADDR."\n",
"From: webmaster".$SERVER_NAME."\nReply-To:
webmaster".$SERVER_NAME."\nX-Mailer: PHP/".
phpversion());
if ($bomb)
die($subj.": ".$msg);
else
echo $subj.": ".$msg;
return $r;
}
-- end script snippet1 --
It's in it's own include file which is then called as:
-- start script snippet2 --
status_mail(false, "Success", "Zip search database rebuilt.\n\nNum of records:
".$i);
-- end script snippet2 --
$i is an int if that makes any difference.
Any ideas?
Joel