esepich Posted March 15, 2013 Share Posted March 15, 2013 I have this link: http://qtmtrk.com/?a=23&c=455&s1=111&s2=222&s3=333&s4=444&s5=555 that leads to my own index.php. I am wondering why my REQUEST_URI would be blank when it comes in on my index.php? Link to comment Share on other sites More sharing options...
Rollins Posted March 15, 2013 Share Posted March 15, 2013 (edited) the link you posted seems incomplete..... but try requesting 'PATH_INFO' or 'ORIG_PATH_INFO' . see if that puts out anything.... Edited March 15, 2013 by Rollins Link to comment Share on other sites More sharing options...
justsomeguy Posted March 15, 2013 Share Posted March 15, 2013 There's no URI there, you're not requesting a specific file. If you run that URL through parse_url: http://php.net/manual/en/function.parse-url.php you'll see that it will set the scheme to "http", the host to "qtmtrk.com", the path (URI) will be blank because you're not requesting a specific file, and the querystring will be "a=23&c=455&s1=111&s2=222&s3=333&s4=444&s5=555". Link to comment Share on other sites More sharing options...
Rollins Posted March 15, 2013 Share Posted March 15, 2013 oke...not to hijack this post but.... a URL leads to "just" a location....? a URI leads to a specific location or resource, and can contain some info in the form of location.php?info=random? (and then there is URN wich is name only...?) Link to comment Share on other sites More sharing options...
justsomeguy Posted March 15, 2013 Share Posted March 15, 2013 Technically, a URI can be either a URL, or a URN, or both. PHP's REQUEST_URI value does not contain the entire URI, which would include the scheme, host, etc. It only contains the name of the file that was requested, including the querystring. To build the entire URI you would use part of what is in SERVER_PROTOCOL, plus HTTP_HOST, plus REQUEST_URI. You can get the running script from $_SERVER['SCRIPT_NAME'], $_SERVER['SCRIPT_FILENAME'], or the __FILE__ constant (they don't necessarily have the same values). Normally, people talking use the terms URL and URI interchangeably. Link to comment Share on other sites More sharing options...
Rollins Posted March 16, 2013 Share Posted March 16, 2013 That clarifies it.....Thank you JSG! Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now