Re: getting query string from referer website
| From: | Aidan Lister | Date: | Mon, 28 Jun 2004 10:46:30 +0000 |
| Subject: | Re: getting query string from referer website | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-189137@lists.php.net to get a copy of this message | ||
$_SERVER['QUERY_STRING'] has nothing to do with the refering website.
foo.php?bar=6
The QUERY_STRING for the above example is: bar=6
When someone visits your page, they visit foo.php (for example), thus your
QUERY_STRING will always be blank.
I believe you're looking for HTTP_REFERER
"I.A. Gray" <tech@selectperformers.com> wrote in message
news:GKENIOKKDEHBGNGOCJHNKEEOCJAA.tech@selectperformers.com...
> Hi all,
>
> When I use the $_SERVER to get a query string it doesn't ever seem to
return
> me anything:
>
> $queryy = $_SERVER['QUERY_STRING'];
>
> In my webstats script, 790 are blank and 2 give the value of "loc=uk" and
> "currentID=6" - not very satisfactuary!
>
> Why is this happening? Could I get the search string from the referer web
> site? It sounds like a bit of a faff, but is this what I have to do?
>
> Say a referer website is
>
http://www.google.co.uk/search?q=web+design+for+performers&ie=UTF-8&hl=en&me
> ta=
>
> is there a good way of getting the query string "web design for
performers"
> ?
>
> for Yahoo it is different:
>
>
http://search.yahoo.com/search?p=biography+examples&ei=UTF-8&fr=fp-tab-web-t
> &n=20&fl=0&x=wrt
>
> the search string is followed by "p="
>
> I'd like to list the top ten search keywords and the top ten search
phrases.
>
> Any ideas?
>
> Thanks!