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. 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. 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); ?> 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"? 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 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']; Link to comment https://forums.phpfreaks.com/topic/87213-google-and-yahoo/#findComment-446117 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.