Thanks- didn't realise that $_SERVER['QUERY_STRING'] was the query string for the actual page. In that case what is the easiest way to extract the search string from the referer web site? I would like to add this string to the MYSQL database.
-----Original Message----- From: Aidan Lister [mailto:[EMAIL PROTECTED] Sent: 28 June 2004 11:47 To: [EMAIL PROTECTED] Subject: [PHP] Re: getting query string from referer website $_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" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > 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! -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php