Is there a $_SERVER[] function that returns a string of the directory... , not necessarily "PHP_SELF" but is there another one that will give you with the full URL like ------
"http://website.com/folder1/folder/
excluding the file itself....
$_SERVER[]
Moderator: General Moderators
Re: $_SERVER[]
Not so far as I know. I spent a while looking for this myself, and gave up. You'll have to either parse the string yourself, or figure some other solution.
If you find this, though, I would love to know. It would simplify things.
If you find this, though, I would love to know. It would simplify things.
Re: $_SERVER[]
In $_SERVER the formula is
The :port can be omitted if you're on port 80. If the server is on Windows then dirname will return give you a string with \s that need to be converted to /s.
Code: Select all
"http://" + SERVER_NAME + ":" + SERVER_PORT + dirname(SCRIPT_NAME)Re: $_SERVER[]
would you mind elaborating on that just a bit?
-
truepal20032001
- Forum Commoner
- Posts: 27
- Joined: Mon Jun 25, 2007 8:28 pm
Re: $_SERVER[]
thankyou!tasairis wrote:In $_SERVER the formula isThe :port can be omitted if you're on port 80. If the server is on Windows then dirname will return give you a string with \s that need to be converted to /s.Code: Select all
"http://" + SERVER_NAME + ":" + SERVER_PORT + dirname(SCRIPT_NAME)