doubledee — 2012-09-15T23:17:07-04:00 — #1
I am using a "Pretty URL", and would like to capture it, and store it in $_SESSION['returnToPage'], so that when I later call it, I will be taken back to the page I was on.
How would I do that?
doubledee — 2012-09-15T23:50:04-04:00 — #2
Here are a few "Pretty URL's" that I might want to capture...
raju_gautam — 2012-09-15T23:57:23-04:00 — #3
Have you already tried $SERVER['HTTPREFERER'] ?
logic_earth — 2012-09-15T23:57:50-04:00 — #4
You would use $SERVER['REQUESTURI'] to capture it and stuff it into a session before you move to the next page. Don't use HTTP_REFERER, it is not guaranteed to be available or not contaminated.
doubledee — 2012-09-16T09:57:50-04:00 — #5
Ok, some follow-up questions...
1.) So, is $SERVER['REQUESTURI'] safe to use from a security standpoint?
2.) Will $SERVER['REQUESTURI'] capture any "Pretty URL" scheme that I might have?
3.) Is there any conflict between $SERVER['REQUESTURI'] and my "Pretty URLs" and the "Ugly URL" that my mod_rewrite is creating?
logic_earth — 2012-09-16T10:01:55-04:00 — #6
Is REQUEST_URI safe...no (depends on you use it) but it is the only thing available, as it is what the server provides and uses itself.
REQUEST_URI is whatever is used as the address the client uses within the HTTP request so yes.
No conflict because the server (mod_rewrite) is using REQUEST_URI to match pretty URIs to their real URIs.
Example HTTP request:
<font color='#000000'><font face='monospace'>GET [B]/fancy/pretty/URI/here/access/with/REQUEST/URI/on/server.html[/B] HTTP/1.1
doubledee — 2012-09-16T10:13:38-04:00 — #7
Okay, I think that answers my question. (Now if I can just figure out how to solve my Content-Architecture dilemma?!)