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

    Join Date
    May 2003
    Posts
    2
    Rep Power
    0

    Google API w/PHP


    Came across this article - http://www.devshed.com/Server_Side/P...API/page3.html on DevShed about using the Google Web APIs with PHP.

    I've never worked with OOP/classes in PHP so I'm having a hard time troubleshooting. The problem is that the search request always returns the same set of results. Checking the value of $params[q] throughout the code listed in the article produces the correct query term so I'm assuming that my problem lies in nusoap.php. It appears that the URL of my post is what is actually being delivered to Google by the nusoap class as the query term.

    To see the problem in action, go to - http://www.vincemease.com/postnuke/m...der=0&thold=-1 and scroll down to the bottom. The value that I'm setting for 'q' in the DevShed code is '$preformat[title]' from Postnuke. Hardcoding a search term for 'q' works as expected. Why does this choke when given a variable?

    Any ideas?

    Thanks,
    Vince
    Last edited by vinniem; May 25th, 2003 at 02:07 PM.
  2. #2
  3. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Mar 2002
    Posts
    45
    Rep Power
    13
    What version of PHP are you using?

    If you are using an older version of PHP, you may need to toggle the behaviour of the "register_globals" variable, which controls the manner in which variables are sent between forms. This could explain why you are having no problems when you hardwire the query string, but are unable to get results when the query is a form variable.
    --
    Articles, tutorials and more, all at http://www.melonfire.com/community/columns/trog/
  4. #3
  5. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    May 2003
    Posts
    2
    Rep Power
    0

    PHP version


    The version of PHP I'm running is 4.3.1, and register_globals is on.

IMN logo majestic logo threadwatch logo seochat tools logo