[Xitami] xitami - php (PHP_SELF)
Marcio Marchini
xitami@lists.xitami.org
Tue, 29 Jan 2002 09:54:21 -0500
> When running the phpinfo() to get all the values for the system
> variables etc ... the PHP_SELF variable is blank/empty .... it should
> normally return the URL of the webpage from where you call the
> phpinfo () function or the variable itself.
>
> Anyone have an idea where the mistake might be? some Xitami server
> setting somewhere? perhaps a setting in the php.ini configuration?
> Any help is much appreciated. Thanks!
> God bless you with His grace and peace
This is what I use:
// Under Apache $PHP_SELF is what we want, under Xitami it is $SCRIPT_NAME
// We find out based on which one has ".php" in it.
if (ereg ("\.php", $SCRIPT_NAME)) $CONSTANT_SELF = $SCRIPT_NAME;
else $CONSTANT_SELF = $PHP_SELF;
$CONSTANT_SELF = str_replace ("\\\\", "/", $CONSTANT_SELF);
Then just use $CONSTANT_SELF
marcio