fwrite()ing predefined variables
| From: | Alberto Brea | Date: | Tue, 10 Dec 2002 19:00:52 +0000 |
| Subject: | fwrite()ing predefined variables | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-127695@lists.php.net to get a copy of this message | ||
Hi,
Could somebody please tell me why I can't print pre-defined variables to a file with fwrite()?
The code I use is this:
$filename = '../vlog.txt';
$fd= fopen($filename, 'a');
$a= date(YmdHi);
$b= basename($PHP_SELF);
$c= $HTTP_USER_AGENT;
$d= $HTTP_HOST;
$e= $_SERVER['HTTP_HOST'];
$f= "xxx";
$g= "yyy";
fwrite($fd, "$a#$b#$c#$d#$e#$f#$g\n");
fclose($fd);
And the output I get in the target file is this:
200212101552####localhost#xxx#yyy
Thanks a lot in advance
Alberto