phpretard Posted January 22, 2008 Share Posted January 22, 2008 $_SERVER['HTTP_REFERER'] reads http://www.google.com/search?q=Can+I+Pull+This+Info&rls=com.microsoft:*&ie=UTF-8&oe=UTF-8&startIndex=&startPage=1 When someone hits my site from google. Yahoo has a "p=". Is it possible to capture just the "q=" and/or the "p=" value. Quote Link to comment https://forums.phpfreaks.com/topic/87213-google-and-yahoo/ Share on other sites More sharing options...
themistral Posted January 22, 2008 Share Posted January 22, 2008 use $content = $_GET['p'] and $content will contain the value to the right of the p= until the ampersand. Replace $_GET['p'] with $_GET['q'] for the other value. Quote Link to comment https://forums.phpfreaks.com/topic/87213-google-and-yahoo/#findComment-446095 Share on other sites More sharing options...
rajivgonsalves Posted January 22, 2008 Share Posted January 22, 2008 try this... <?php $strUrl = "http://www.google.com/search?q=Can+I+Pull+This+Info&rls=com.microsoft:*&ie=UTF-8&oe=UTF-8&startIndex=&startPage=1"; $arrUrl = parse_url($strUrl); parse_str($arrUrl['query'],$arrParams); print_r($arrParams); ?> Quote Link to comment https://forums.phpfreaks.com/topic/87213-google-and-yahoo/#findComment-446097 Share on other sites More sharing options...
phpretard Posted January 22, 2008 Author Share Posted January 22, 2008 I am sure you know this prints: Array ( [q] => east polk llc [rls] => com.microsoft:* [ie] => UTF-8 [oe] => UTF-8 [startIndex] => [startPage] => 1 ) How can I isolate "east polk llc"? Quote Link to comment https://forums.phpfreaks.com/topic/87213-google-and-yahoo/#findComment-446103 Share on other sites More sharing options...
tapos Posted January 22, 2008 Share Posted January 22, 2008 Use echo $arrParams['rls']; -- Thanks, Tapos Pal http://tapos/wordpress.com Quote Link to comment https://forums.phpfreaks.com/topic/87213-google-and-yahoo/#findComment-446110 Share on other sites More sharing options...
rajivgonsalves Posted January 22, 2008 Share Posted January 22, 2008 yes I was I though you knew how to operate with arrays... anyways the code is... echo $arrParams['q']; Quote Link to comment https://forums.phpfreaks.com/topic/87213-google-and-yahoo/#findComment-446117 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.