[PHP] fwrite()ing predefined variables

2002-12-10 Thread Alberto Brea
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:
200212101552localhost#xxx#yyy

Thanks a lot in advance

Alberto



Re: [PHP] fwrite()ing predefined variables

2002-12-10 Thread Jason Wong
On Wednesday 11 December 2002 03:00, Alberto Brea wrote:
 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:
 200212101552localhost#xxx#yyy

Because some pre-defined variables aren't pre-defined anymore. Read the 
variables section of the manual or use phpinfo() to see which really are 
pre-defined.

-- 
Jason Wong - Gremlins Associates - www.gremlins.biz
Open Source Software Systems Integrators
* Web Design  Hosting * Internet  Intranet Applications Development *

/*
Q:  How do you know when you're in the ethnic section of Vermont?
A:  The maple sap buckets are hanging on utility poles.
*/


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] fwrite()ing predefined variables

2002-12-10 Thread Alberto Brea
All these variables show on the browser quite well from a regular .php file, so they 
are still pre-defined, but I can't fprint() them to a text file.