#1
  1. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Mar 2002
    Location
    Ireland
    Posts
    3
    Rep Power
    0

    Question Piggyback Google?


    Hello all!
    Does anyone of you know how I can "piggyback" google for my site?
    Is there code out there for this or is it just a matter of linking up to them and hiding their icon (clueless about this also!)?

    I'm told that this is really simple to do but am unable to find out anything about it!
    Any help would be greatly appreciated by my dumb-***!

    By-the-by, this site will never be public so the google bods won't be wronged.
  2. #2
  3. Introspective
    Devshed Loyal (3000 - 3499 posts)

    Join Date
    Nov 2001
    Location
    London, UK
    Posts
    3,317
    Rep Power
    111

    This might help


    I think I know what you mean... so paste this code into your page:

    <center>
    <FORM method=GET action="http://www.google.com/search">
    <TABLE bgcolor="#FFFFFF"><tr><td>
    <A HREF="http://www.google.com/">
    <IMG SRC="http://www.google.com/logos/Logo_40wht.gif"
    border="0" ALT="Google" align="absmiddle"></A>
    <INPUT TYPE=text name=q size=25 maxlength=255 value="">
    <INPUT type=submit name=btnG VALUE="Google Search">
    </td></tr></TABLE>
    </FORM>
    </center>

    if you don't like the logo image, you can choose a different one from http://www.google.com/stickers.html.

    Don't worry about 'wronging' anyone, Google take traffic wherever it comes from and encourage site owners to host their search box.

    Btw, you have the same name as my twin sister -

    Christo
    This is me: http://chris.uk.com
  4. #3
  5. Contributing User
    Devshed Intermediate (1500 - 1999 posts)

    Join Date
    Oct 2001
    Location
    New Zealand
    Posts
    1,774
    Rep Power
    25
    The thing is pretty simple for a normal search:

    Just change the browser location to:

    http://www.google.com/search?hl=en&q=[*]&btnG=Google+Search

    and replace[*] with the escaped search term. For example:

    http://www.google.com/search?hl=en&q...=Google+Search

    that'll call the page with search results. Now you need to read the output of that into an array using php:

    $file = file("http://www.google.com/search?hl=en&q=find+me+some+food&btnG=Google+Search");

    and parse it using:

    while (list ($line_num, $line) = each ($file)) {

    }

    what you're after is from the first line that starts with a <p> tag to the start of the last line that starts with a <p> tag. Then put this in your page and you should get the Google without the Google. It may need a bit of tidying up though!
  6. #4
  7. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Mar 2002
    Location
    Ireland
    Posts
    3
    Rep Power
    0

    Talking


    Much obliged for your answers.

    I'll try it out tomorrow and let you know.

    Thanks again,

    Laura

IMN logo majestic logo threadwatch logo seochat tools logo