Gben 20 Posted February 8, 2010 I'm playing with google custom search, trying to create one. I found this helpful script which I understand how to customise so that google will search: all of google or just website #1 or just website #2 <form method="get" action="http://www.google.com/search"> <div style="border:1px solid black;padding:4px;width:20em;"> <table border="0" cellpadding="0"> <trtd> <input type="text" name="q" size="25" maxlength="255" value="" /> <input type="submit" value="Google Search" /></td/tr> <trtd align="center" style="font-size:75%"> <input type="checkbox" name="sitesearch" value="website #1" checked /> only search website #1<br /> <input type="checkbox" name="sitesearch" value="website #2" checked /> only search website #2<br /> </form> But how do I change the script so that it searches: all of google or just website #1 or just website #2 both website #1 and website #2 but not the rest of google I tried just adding multiple sites to the value line, but it doesn't work. How should it be done? <input type="checkbox" name="sitesearch" value="website #1, website #2" checked /> search website #1 & #2 only<br /> Share this post Link to post
Doctor Destiny 40 Posted February 8, 2010 You cannot comma separate values like that. You would have to pass a new search string to search both sites instead of one at a time. Share this post Link to post
Doctor Destiny 40 Posted February 9, 2010 hmm... you may need JavaScript for that. Why do you need to pass multiple sites, anyway? Share this post Link to post
Gben 20 Posted February 9, 2010 hmm... you may need JavaScript for that. Why do you need to pass multiple sites, anyway? Think in terms of searching just "Dell Australia" first, and/or "All DELL sites" (US, ASIA etc). Share this post Link to post
Doctor Destiny 40 Posted February 9, 2010 If you just pass the form information as a post to Google using its search form, you could easily pass the necessary query. Though... not sure how custom it would actually be. Maybe you should look this one up. I'm not too fluent on Google's custom search API... Share this post Link to post