Click to See Complete Forum and Search --> : quick predefined variable question
hammerslane
12-11-2003, 05:12 AM
i know that $PHP_SELF gets the document file name, and the path. (eg. "/path/to/file.php") - is there a pre defined variable to get just the file name? or would i have to mess around with the string after geting $PHP_SELF ?
thanks
You'd just use basename() (http://us4.php.net/basename). Also, I would not use register_globals. Use this: $_SERVER['PHP_SELF'] instead of $PHP_SELF.
hammerslane
12-11-2003, 07:38 AM
thanks for the tip
what's wrong with register_globals?
i'm not arguing, i'm just asking why it's best to put $_SERVER.
this command will be used on my company intranet... does the is it still best to use $_SERVER?
many thanks
You should not use register globals because of security (http://us4.php.net/manual/en/security.registerglobals.php) issues, and because they can be turned off in the php.ini file, and thus makes your code not portable.