Re: PHP 4.0 Bug #3305: Global vars and mail() unpredictability

From: Date: Mon, 24 Jan 2000 22:44:45 +0000
Subject: Re: PHP 4.0 Bug #3305: Global vars and mail() unpredictability
References: 1  Groups: php.dev 
Request: Send a blank email to php-dev+get-14893@lists.php.net to get a copy of this message
joel@nextstudio.com writes: > 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. > [trimmed] > -- 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") { global $SERVER_NAME, $REQUEST_URI, $REMOTE_ADDR, $QUERY_STRING; > $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; > } > [trimmed] > > Any ideas? > > Joel Check out http://www.php.net/manual/language.variables.scope.php3 for more information. -- +----------------------------------------------------------------+ |Torben Wilson <torben@php.net> Netmill iTech| |http://www.coastnet.com/~torben http://www.netmill.fi| |Ph: 1 250 383-9735 torben@netmill.fi| +----------------------------------------------------------------+

« previous php.dev (#14893) next »