How can I add an integrated Google search to my website?

大兔子大兔子 提交于 2019-11-28 08:34:05
Karan

https://cse.google.com/cse/

^ Perhaps you're looking for Google Custom Search Engine

VonC

Like this

<form method="get" action="http://www.google.com/search">

<div style="border:1px solid black;padding:4px;width:20em;">
<table border="0" cellpadding="0">
<tr><td>
<input type="text"   name="q" size="25"
 maxlength="255" value="" />
<input type="submit" value="Google Search" /></td></tr>
<tr><td align="center" style="font-size:75%">
<input type="checkbox"  name="sitesearch"
 value="askdavetaylor.com" checked /> only search Ask Dave Taylor<br />
</td></tr></table>
</div>

</form>

For displaying the results in a separate frame, you have this site as an example.

That would be something along the lines of:

<html>
<head>
    <meta http-equiv="Content-Language" content="en-gb">
    <meta http-equiv="Content-Type" content="text/html; charset=windows-1252">

    <script language="javascript" type="text/javascript">
    function showFrame () {
        var e = document.getElementById("if1");
        e.style.visibility = "visible" ;
    }
    </script>
</head>

<body>
    <p> </p>
    <p>
    <span id="spSearch" onclick="showFrame()">Search</span>
    </p>
    <p> </p>
    <p><iframe name="I1" id="if1" width="100%" height="254" style="visibility:hidden" src="http://www.google.co.uk">
        Your browser does not support inline frames or is currently configured not to display inline frames.
    </iframe></p>
</body>
</html>

For a free solution based on the main Google index using a site: query and only a little control of the look and feel, try Google Custom Search Engine.

For a few hundred dollars, with a more comprehensive and up-to-date index of your site, and complete control of the look-and-feel, try Google Site Search.

For enterprises which need complete control of all aspects of the index and the search experience, and need anything from thousands to millions of items in the index, try the Google Search Appliance.

As another answerer listed, I beleieve Custom Search is what you are looking for.

Just wanted to provide additional info. Google also has Site Search, but you need to pay for it.

Take a look at Google Webmaster tools: http://www.google.com/webmasters/

In particular: http://www.google.com/sitesearch/

An easy way to have a customized google search is to use adsense for search, it allows you to :

  • Search in one or more sites, or the whole internet.
  • Open in a new window, current window or iframe.
  • Customize the colors of the search results.
  • It could also pay you cents for any clicks on the ads.

This same answer i have suggested earlier to another question so this is the answer

Go to this link https://www.google.com/cse/ and create account Create your custom search box Customize looks as your wish Copy the code after customizing Paste in your blog or website where you want the search box to appear..

And if you want search box like my site http://www.latestgames2.com/ just customized all the colors and shapes

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!