SitePoint Sponsor

User Tag List

Results 1 to 4 of 4
  1. #1
    SitePoint Enthusiast geeOff's Avatar
    Join Date
    Jul 2001
    Location
    Atlanta, GA 30328
    Posts
    72
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Question massage query for redirect to google

    Hey All --

    I am trying to duplicate what PHP.net is doing from their search page when you search on keywords & specify the "whole site":
    http://us2.php.net/search.php

    I believe their search.php takes the keyworks, trims the L & R spaces, checks for bad characters & then substitutes spaces between keywords for "+" pluses. Then the cleaned-up string is redirected to google.com using the "site search" method like so:
    http://www.google.com/search?q=searc...w.php.net&l=en

    My question is: does anyone have a string manipulation script that can get me close ? My biggest problem is checking for bad characters as i am not too good with reg expressions. I can figure out the trimming, substitutions & re-direct. Or maybe someone has a search query validator ?

    THX !!
    Geoff -- see you at www.carsonworkshops.com in 02/2005.

  2. #2
    dooby dooby doo silver trophybronze trophy
    spikeZ's Avatar
    Join Date
    Aug 2004
    Location
    Manchester UK
    Posts
    13,788
    Mentioned
    153 Post(s)
    Tagged
    3 Thread(s)
    Hi geeOff, first up I think you are looking in the wrong place for massages!
    (thread title)

    SpikeZ
    Mike Swiffin - Community Team Advisor
    Only a woman can read between the lines of a one word answer.....

  3. #3
    SitePoint Enthusiast geeOff's Avatar
    Join Date
    Jul 2001
    Location
    Atlanta, GA 30328
    Posts
    72
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Talking

    heh-heh. i *thought* that might get your attention! hey web geeks need massages too ya know. <ahem>
    Geoff -- see you at www.carsonworkshops.com in 02/2005.

  4. #4
    SitePoint Enthusiast geeOff's Avatar
    Join Date
    Jul 2001
    Location
    Atlanta, GA 30328
    Posts
    72
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Red face

    sorry, i hate it when i answer my own question. Philip from PHP.net was kind enough to answer. the link he sent me is a GOLDMINE of PHP code...kicking myself i never knew about this before. this is the specific page i was wondering about: http://cvs.php.net/phpweb/search.php...23675cab55e2c7


    The entire php.net site is available to the world at:
    http://cvs.php.net/phpweb/

    urlencode() is most likely what you want.

    Regards,
    Philip
    Geoff -- see you at www.carsonworkshops.com in 02/2005.


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •