What happened to the Messenger Plus! forums on msghelp.net?
Shoutbox » MsgHelp Archive » Skype & Technology » Tech Talk » get URI folder for executing PHP script

get URI folder for executing PHP script
Author: Message:
WDZ
Former Admin
*****

Avatar

Posts: 7106
Reputation: 107
– / Male / Flag
Joined: Mar 2002
RE: get URI folder for executing PHP script
quote:
Originally posted by MeEtc
I do know that $_SERVER['REQUEST_URI'] contains the full url, but it is not cross platform. (*cough* IIS *cough*)
Code stolen from WordPress... :tongue:
code:
// Fix for IIS, which doesn't set REQUEST_URI
if ( empty( $_SERVER['REQUEST_URI'] ) ) {
    $_SERVER['REQUEST_URI'] = $_SERVER['SCRIPT_NAME']; // Does this work under CGI?

    // Append the query string if it exists and isn't null
    if (isset($_SERVER['QUERY_STRING']) && !empty($_SERVER['QUERY_STRING'])) {
        $_SERVER['REQUEST_URI'] .= '?' . $_SERVER['QUERY_STRING'];
    }
}
REQUEST_URI won't contain the hostname though... you can get that from HTTP_HOST.
08-29-2007 12:27 AM
Profile PM Web Find Quote Report
« Next Oldest Return to Top Next Newest »

Messages In This Thread
get URI folder for executing PHP script - by MeEtc on 08-28-2007 at 11:49 PM
RE: get URI folder for executing PHP script - by WDZ on 08-29-2007 at 12:27 AM
RE: get URI folder for executing PHP script - by MeEtc on 08-29-2007 at 12:37 AM
RE: get URI folder for executing PHP script - by roflmao456 on 08-29-2007 at 12:40 AM
RE: get URI folder for executing PHP script - by WDZ on 08-29-2007 at 12:58 AM
RE: get URI folder for executing PHP script - by MeEtc on 08-29-2007 at 02:41 AM
RE: get URI folder for executing PHP script - by roflmao456 on 08-29-2007 at 03:27 AM


Threaded Mode | Linear Mode
View a Printable Version
Send this Thread to a Friend
Subscribe | Add to Favorites
Rate This Thread:

Forum Jump:

Forum Rules:
You cannot post new threads
You cannot post replies
You cannot post attachments
You can edit your posts
HTML is Off
myCode is On
Smilies are On
[img] Code is On