13

Basically I have a website. I have a properly setup sitemap so I assume Google knows about all of my pages. And I've seen on some sites, the search form leads to a page with the shell of the original site but the results are clearly provided by Google. Similar to codinghorror.com's search, however his results aren't shown within his website's layout.

Any idea what I'm talking about or how to achieve this?

kristof
  • 52,923
  • 24
  • 87
  • 110
Andrew G. Johnson
  • 26,603
  • 30
  • 91
  • 135
  • HERE, IT IS VERY SIMPLE: https://neculaifantanaru.com/en/how-can-i-integrate-google-search-box-to-my-website-by-implementing-custom-code.html – Just Me Jun 24 '21 at 16:40

6 Answers6

14

Nov. 2008: Like this (but you will find a more up-to-date 2012 example here)

<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>
VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250
  • This just forwards the query to Google, I'm talking about having the results show up in your layout. Is it possible what I've seen is simply an iframe? – Andrew G. Johnson Nov 08 '08 at 20:35
  • where exactly do I copy/paste the `
    ` in the html page? Must be another page?
    – Just Me May 05 '21 at 08:59
  • @JustMe 13 years later, am I not so sure, but I would assume directly in the body of your HTML page. I have restored the first link: https://web.archive.org/web/20081231030633/http://www.askdavetaylor.com/how_can_i_add_a_google_search_box_to_my_web_site.html. It does show you an example. – VonC May 05 '21 at 10:03
  • thanks, I find the answer here https://stackoverflow.com/questions/13822927/how-can-i-add-a-google-search-box-to-my-website/ – Just Me May 05 '21 at 15:14
  • @JustMe OK, thank you for the feedback. I have included your link in the answer for more visibility. – VonC May 05 '21 at 17:12
14

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

^ Perhaps you're looking for Google Custom Search Engine

naXa stands with Ukraine
  • 35,493
  • 19
  • 190
  • 259
Karan
  • 1,636
  • 4
  • 19
  • 35
5

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.

Liam
  • 19,819
  • 24
  • 83
  • 123
3

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/

dtc
  • 10,136
  • 16
  • 78
  • 104
1

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.
Osama Al-Maadeed
  • 5,654
  • 5
  • 28
  • 48
-1

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

MM Nauman
  • 31
  • 1