greg_baka — 2012-10-22T23:39:08-04:00 — #1
I am working with a Search Box that I want to only search a specific site. To get it to do that I need to add the following to the front of each search query site:www,mysite,com
(I used commas just to keep it from showing here as an UL)
This is just like what people would do from one of the major search engines IF they new that adding site:www,mysite,com to their query would limit the results to only that site's results :rolleyes:
Here is a sample of the current code:
<form class="navbar-search" method="get" action="http://www.searchengine.com/search" >
<input type="text" name="query">
Basically I just want to automatically always add or apend this text site:www,mysite,com to "query" when it is submitted. Is this possible? How???
ralphm — 2012-10-22T23:45:43-04:00 — #2
Is this a Google search? If so, you can get the form code from Google itself.
<form method="get" action="http://www.google.com/search">
<label for="q">Search this Site</label>
<input type="text" name="q" id="q" value="">
<input type="submit" value="Search">
<input type="hidden" name="sitesearch" value="mysite.com">
greg_baka — 2012-10-23T07:30:13-04:00 — #3
Hi Ralph, thanks for the quick response!
Your code works great - but unfortunately I think it is a backdoor way of getting "Google Site Search" which is supposed to cost $100 a year. See http://www.google.com/enterprise/search/products_gss.html
We can't afford to piss off the Google monster
I'm looking for something that can be used with any smaller alternative searchengine that allows having the search result narrowed to a particular site...
ralphm — 2012-10-23T08:06:24-04:00 — #4
That's if you want the customized version, but there's nothing wrong with using the code I posted. It's just a bit of a plain experience, but there's not problem using it. It's provided by Google.