WordPress.org

Ready to get started?Download WordPress

Forums

Search in Google after Wp search (3 posts)

  1. vsa
    Member
    Posted 10 years ago #

    How can i retrieve the string that the user searches in my blog so that i could give him the chance of searching it in Google afterwards?
    Try to search something on my website. if nothing is found you´ll have the usual message of "sorry, bla bla", and also my new "invention" of "try to search Google".
    Unfortunately the user has to type once more the text he was searching..
    Can anybody help me?

  2. carthik
    Member
    Posted 10 years ago #

    The search string is passed as the GET variable "s".

  3. Beel
    Member
    Posted 10 years ago #

    I guess I could clean up the whole thing for you so at least this part doesn't cause validation issues:
    href="http://www.google.com/search?hl=en&ie=UTF-8&q=<?php echo $s; ?>"><img height="18"
    src="images/google.png" width="46" alt="Google Image" />

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.