Bug #12310 Updated: $SCRIPT_FILENAME
| From: | andy@php.net | Date: | Sun, 22 Jul 2001 23:49:12 +0000 |
| Subject: | Bug #12310 Updated: $SCRIPT_FILENAME | ||
| References: | 1 | Groups: | php.dev |
| Request: | Send a blank email to php-dev+get-60702@lists.php.net to get a copy of this message | ||
ID: 12310
Updated by: andy
Reported By: michael@frifra.de
Old Status: Bogus
Status: Feedback
Old Bug Type: Any
Bug Type: Variables related
Operating System: WinNT IIS
PHP Version: 4.0.6
New Comment:
Please replace $SCRIPT_FILENAME with
$HTTP_SERVER_VARS["SCRIPT_FILENAME"]
so $path=dirname($SCRIPT_FILENAME);
would be changed to
$path=dirname($HTTP_SERVER_VARS["SCRIPT_FILENAME"]);
Please tell me if this works.
Status -> Feedback
Type -> Variables related
Previous Comments:
------------------------------------------------------------------------
[2001-07-22 19:42:43] michael@frifra.de
If i use this code:
$path=dirname($SCRIPT_FILENAME);
the variable $path is empty, because $SCRIPT_FILENAME is empty!
if a type in the complete path as static variable, it works... but i have to use
dirname($SCRIPT_FILENAME) for the possibility to run that script on other servers.
------------------------------------------------------------------------
[2001-07-22 19:34:33] andy@php.net
Try using $HTTP_SERVER_VARS["SCRIPT_FILENAME"]
instead of $SCRIPT_FILENAME.
------------------------------------------------------------------------
[2001-07-22 19:30:29] michael@frifra.de
In my php.ini is:
register_globals = ON
if i declare
global $SCRIPT_FILENAME -> i get an empty string! On all other servers i can run my script, only
on my own... why?
------------------------------------------------------------------------
[2001-07-22 18:18:16] andy@php.net
Also, make sure that register_globals is set to on in your
php.ini file.
------------------------------------------------------------------------
[2001-07-22 18:10:50] andy@php.net
This is because microsoft's directory structure uses backslashes
, not forward slashes in your script. Try replacing the "/" with "\\"
------------------------------------------------------------------------
The remainder of the comments for this report are too long. To view
the rest of the comments, please view the bug report online at
http://bugs.php.net/?id=12310
Edit this bug report at http://bugs.php.net/?id=12310&edit=1