hno Posted January 22, 2010 Share Posted January 22, 2010 HI, I'm sure you have already experienced this:When you search in google and open some result you see that some of the sites has search what exactly you search in google and show the result in his/her web page.This result can be exactly the google search result or the result from his/her website.How can make something like that.I want to have a search in my site which search what people search in google and That search in my site content and show the result from my content. I'm apologize if my english in not good. Thanks Quote Link to comment https://forums.phpfreaks.com/topic/189428-qestion-about-google-search-result-in-websites/ Share on other sites More sharing options...
oni-kun Posted January 22, 2010 Share Posted January 22, 2010 You can use analytics such as Google Analytics (Free) or simply log the referrers from $_SERVER['HTTP_REFERRER'] The referrer may be: www.google.com/search?q=yoursite+foobar&hl=en .. Extract "q=yoursite+foobar" to get the keywords they entered in search to get to your site. If that's what you wanted. Quote Link to comment https://forums.phpfreaks.com/topic/189428-qestion-about-google-search-result-in-websites/#findComment-999885 Share on other sites More sharing options...
hno Posted January 22, 2010 Author Share Posted January 22, 2010 You can use analytics such as Google Analytics (Free) or simply log the referrers from $_SERVER['HTTP_REFERRER'] The referrer may be: www.google.com/search?q=yoursite+foobar&hl=en .. Extract "q=yoursite+foobar" to get the keywords they entered in search to get to your site. If that's what you wanted. Thanks for your reply, But how can my website understand what does people has been searched in google? What can $_SERVER['HTTP_REFERRER'] do for us? Thanks Quote Link to comment https://forums.phpfreaks.com/topic/189428-qestion-about-google-search-result-in-websites/#findComment-999916 Share on other sites More sharing options...
oni-kun Posted January 22, 2010 Share Posted January 22, 2010 A referrer is what the client sends when pressing a link (usually with most browsers). If a user clicks on your website from a link in google (on google search), The referrer will be google.com/search?q=widgets for example. If they searched 'widgets' in google, and clicked on your site, you know what they searched to get to your site (from the referrer) Quote Link to comment https://forums.phpfreaks.com/topic/189428-qestion-about-google-search-result-in-websites/#findComment-999918 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.