<style type="text/css">
@import url();
</style>
<div class="cse-branding-right" style="background-color:#FFFFFF;color:#000000">
  <div class="cse-branding-form">
    <form action="http://www.google.com/cse" id="cse-search-box">
      <div>
        <input type="hidden" name="cx" value="partner-pub-6100254856836263:mrth7zw2wa0" />
        <input type="hidden" name="ie" value="ISO-8859-1" />
        <input type="text" name="q" size="31" />
        <input type="submit" name="sa" value="Google Search" />
      </div>
    </form>
  </div>
</div>

For an example:

Google Search

For an example:

Google Search

Dani AI

Generated

The example posted is the classic, quick-hosted search form approach. It still works as a concept, but Google’s tooling has evolved since 2009. Use the Programmable Search Engine admin to generate up-to-date embed code if you want the hosted results box, or use the Custom Search JSON API if you need a fully custom results UI that you render yourself.

Practical setup (high level): create a search engine in Google’s console and tell it what to search (your site or the wider web). Choose whether you want Google to host the results page or whether you’ll embed the results element on your own page. For a custom look, enable the JSON API in the Google Developers Console, get an API key, and request/ render results from your server or client code.

Troubleshooting checklist: make sure your page uses UTF-8 and loads Google scripts over HTTPS; confirm the engine is configured to include the domains you expect; check the browser console for blocked scripts or CSP errors; test the engine from the Google admin UI to confirm it returns results; if using the JSON API verify API key, quotas and billing are set. For responsive sites, load the search element asynchronously and style its container so results flow on small screens.

A few caveats: free programmable search typically includes Google branding or ads — read current docs before trying to remove branding. ’s idea to turn this into a snippet/article is useful: show both the hosted embed and the JSON-API route and compare pros/cons. is correct in spirit — the Google-generated code is the fastest path — but double-check the engine settings and modern requirements before copying an old snippet.

Recommended Answers

All 2 Replies

Would be good as a code snippet and maybe an article on codeproject. ;D

you can add the google code from your site.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.