You are invited to Log in or Register a free Frihost Account!

Free google site search.

In my time of surfing the interenet for codes. I came by this quite usefull and ingenios script you can search your site using google.

What the code actualy does is takes advantage of a little thing google has built into there search if you search google like this "site: forum" It will search the site for any words on the site forum.

There is a code that actualy allows you to add a text box to your site when you type something in to it and click the sumbit button it will actualy go to google type in site: (then the site you have filled into the code) (then what was typed into the text box). Which will bring up all the results on that site with those words in order from best results to least best results.

Here is the code where it says type in the site you want it to auto fill in.

<script type="text/javascript">

var domainroot=""

function Gsitesearch(curobj){
curobj.q.value="site:"+domainroot+" "+curobj.qfront.value


<form action="" method="get" onSubmit="Gsitesearch(this)"&gt;

<p>Search this site using google:<br />
<input name="q" type="hidden" />
<input name="qfront" type="text" style="width: 180px" /> <input type="submit" value="Search" /></p>


This code has been on alot of sites that I have seen so I don't know the exact site I found it from but I bet if you searched google you could find it.

There is one down fall to it when in IE(Internet Explorer) it does cause a caution bar warning the viewer of active x content. It won't work properly till the veiwer right clicks on the pop up bar and clicks allow active x content. Which can be annoying since alot of people won't do that even I have forgotten to do it and just clicked the x on the bar and have the code not work.

Edit: Forgot to add last paragraph. ^
Related topics
Google AJAX Search API
Google's Search Engine Performance Drop
My free Classifieds site....
Google's Search engine and its lies
Google Site Maps (Help you get in google)
Best Not-Laggy Free Blog Site?
Google Book Search
advanced search engine
suggest a free hosting site supporting Joomal 1.5
Site Search Tool for a Flash Site.
free sms site?
How to Have your Own search Engine on Your Site
phew that banners gone
Which search engine do you prefer?
Reply to topic    Frihost Forum Index -> Scripting -> Html, CSS and Javascript

© 2005-2011 Frihost, forums powered by phpBB.