Getting the query - I am doing it wrong

Status
Not open for further replies.

emp

New member
Jun 29, 2006
7,465
211
0
OK, I am working on my own little ad tracking system and want to catch the querystring from the URL.

Somehow,
Code:
parse_url($_SERVER['HTTP_REFERER']);
does NOT give me a query value, although you will find it should everywhere on them intartubes.

Right now, I am doing it like this, using the request URI instead.

Code:
$refer = parse_url($_SERVER['HTTP_REFERER']);  
    $host = $refer['host'];  
    
    $refer = parse_url($_SERVER['REQUEST_URI']);
    $query = $refer['query'];

(two sperate functions, just pasted this together)

Code:
$query = $refer['query'];

does NOT work when I use it with the HTTP Referer.

Anyone? or should I keep my ham-handed way of doing this?

::emp::
aka
The guy who is working on a fucking TUTORIAL about this. :anon.sml:
 


No, I did not.

The funny thing is that $SERVER seems to hold the query, just not in the HTTP_REFERER but in REQUEST_URI.

All the documentation I've seen (books, internet) puts it in the HTTP_REFERER tho.

Meh...

::emp::
 
Status
Not open for further replies.