Re: $SCRIPT_NAME Problem
| From: | Brad Harriger | Date: | Tue, 24 Sep 2002 19:41:55 +0000 |
| Subject: | Re: $SCRIPT_NAME Problem | ||
| References: | 1 | Groups: | php.windows |
| Request: | Send a blank email to php-windows+get-15981@lists.php.net to get a copy of this message | ||
I got it figured out. I needed $PHP_SELF instead.
Brad
Brad Harriger wrote:
I'm trying to create a simple script that logs access to several pages on a site I'm working on. I want to capture the date and time, address of the PC accessing the page, and the name of the script being accessed. I have the following code: <?php $today = date("F j, Y H:i:s"); $lineOut = $REMOTE_ADDR; $lineOut .= " "; $lineOut .= $today; $lineOut .= " "; $lineOut .= $SCRIPT_NAME; $lineOut .= "\n"; $fp = fopen("logfile.txt","a"); fputs($fp,$lineOut); fclose($fp); ?> Everything works fine except for the line "lineOut .= $SCRIPT_NAME;" The value of $SCRIPT_NAME is always the path to the PHP executable, not the script that contains the code. How do I correct this problem. I'm running PHP 4.06 under Apache 1.3.22 on a Win 2000 PC. Thanks in advance, Brad