How to Embed Google Search inside websites?

Discussion in 'PHP and MySQL' started by flek, Aug 28, 2010.

Thread Status:
Not open for further replies.
  1. flek Banned

    Hi guys,

    it's a women's health care and beauty tips magazine which is just published. I would like to add a sidebar widget where members can search for any keywords where I have to add 'womens' with each of their search keywords and display the results of Google search in the same widget area. Would that be possible?


    Thanks.

    Have a good day!
  2. Geoff Tyrer Member

    I use the following (taken from "Build your own Web Site the Right Way" by Ian Lloyd):
    <form method="get" action="http://www.google.com/search">
    <label for="q">Search:</label>
    <input id="q" name="q" size="38" maxlength="255" value=" " type="text" />
    <input name="domains" value="http://www.YourDomain/" type="hidden" />
    <input name="sitesearch" value="http://www.YourDomain/" checked="checked" id="mysite" type="radio" />
    <label for="mysite">Just this site</label>
    <input name="sitesearch" value=" " id="www" type="radio" />
    <label for="www">web</label>
    <input name="btnQ" value="Go" type="submit" />
    </form>


    Note that for this to be usable Google must have indexed your site. This won't give you exactly what you want - just a basic Google search capability but it could be a starting point for you.
Thread Status:
Not open for further replies.