Google search of website using php form
Posted: Mon Oct 27, 2003 6:17 pm
We have decided to make use of the Google search engine to search our website and have been looking at a few differant ways of doing it, the first would be the Google API and PHP/SOAP however I have too many projects on my hand to setup/test PEAR/SOAP + the API and would like to impliment something simple.
I decided it would be best to mimic the search on php.net and thought it would be simple enough to make a form and have it submit to a redirect that forms the search into a Google search url (Search+String+Site:mysite.com).
I've built my script and it will search correctly if I only input a single keyword; however spaces (" ") need to become pluses ("+") otherwise Google doesnt know what to do with multiple keywords.
All I really want is exactly what they have done on php.net, to take my entered words, seperate them by spaces and add the site:mysite.com option so it will use Google's index for items that are only part of my site. Does anyone have any reccomendations for how to finish this? Better yet has anyone ever done this before and would be willing to share their code?
Any help appreciated!
-Erik
I decided it would be best to mimic the search on php.net and thought it would be simple enough to make a form and have it submit to a redirect that forms the search into a Google search url (Search+String+Site:mysite.com).
I've built my script and it will search correctly if I only input a single keyword; however spaces (" ") need to become pluses ("+") otherwise Google doesnt know what to do with multiple keywords.
All I really want is exactly what they have done on php.net, to take my entered words, seperate them by spaces and add the site:mysite.com option so it will use Google's index for items that are only part of my site. Does anyone have any reccomendations for how to finish this? Better yet has anyone ever done this before and would be willing to share their code?
Any help appreciated!
-Erik