Re: How do I display the script file name?
| From: | Stephen Ford | Date: | Thu, 27 Feb 2003 17:51:15 +0000 |
| Subject: | Re: How do I display the script file name? | ||
| References: | 1 2 3 4 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-137441@lists.php.net to get a copy of this message | ||
I've checked up on strings, and it seems like the quoting is like the Korn
shell.
You can see below that I found basename() which works fine with __FILE__,
but $_SERVER['PHP_SELF'] etc print nothing. Any ideas?
Stephen
=====PHP======
<?php
echo '<P>$_SERVER[\'PHP_SELF\']=
'.$_SERVER['PHP_SELF']."</P>";
echo '<P>$_SERVER[\'SCRIPT_NAME\']
(etc)='.$_SERVER['SCRIPT_NAME'].' '.
$_SERVER['SCRIPT_FILENAME'].' '.
$_SERVER['PHP_SELF']."</P>";
echo '<P>__FILE__='.__FILE__."</P>";
echo '<P>$SCRIPT_FILENAME='.$SCRIPT_FILENAME."</P>";
echo "<P>Basename=".basename(__FILE__)."</P>";
?>
==IE6 Display=========
$_SERVER['PHP_SELF']=
$_SERVER['SCRIPT_NAME'] (etc)=
__FILE__=/path/sfindex03.php
$SCRIPT_FILENAME=/path/sfindex03.php
Basename=sfindex03.php
===========