Results 1 to 6 of 6

Thread: [RESOLVED] Opening $_GET urls?

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Jul 2005
    Posts
    236

    Resolved [RESOLVED] Opening $_GET urls?

    Hi y'all,

    I want to extract data from Google in a specific search.

    But when I use
    PHP Code:
        $filename "http://www.google.com/search?hl=en&q=$somequery";
        
    $handle fopen($filename"r");
        
    $contents fread($handlefilesize($filename));
        
    fclose($handle);
        echo 
    $contents
    I get the error:

    Warning: fopen("http://www.google.com/search?hl=en&q=(somequery)", "r") - No error in c:\apache\htdocs\intranet\revision_a\getdata.php on line 100

    Warning: stat failed for http://www.google.com/search?hl=en&q=(somequery) (errno=2 - No such file or directory) in c:\apache\htdocs\intranet\revision_a\getdata.php on line 101


  2. #2
    KrisSiegel.com Kasracer's Avatar
    Join Date
    Jul 2003
    Location
    USA, Maryland
    Posts
    4,985

    Re: Opening $_GET urls?

    You should be using Google's API as what you're trying to do is against their policy and if your script does it alot, you could get banned from Google (or at least your server).
    KrisSiegel.com - My Personal Website with my blog and portfolio
    Don't Forget to Rate Posts!

    Free Icons: FamFamFam, VBCorner, VBAccelerator
    Useful Links: System.Security.SecureString Managed DPAPI Overview Part 1 Managed DPAPI Overview Part 2 MSDN, MSDN2, Comparing the Timer Classes

  3. #3
    <?="Moderator"?> john tindell's Avatar
    Join Date
    Jan 2002
    Location
    Brighton, UK
    Posts
    1,099

    Re: Opening $_GET urls?

    http://www.google.com/api

    You need to get a free serial and then your good to go, to use it with PHP you need to have access to a SOAP library, either through pear, or buy using nusoap from sf. There are others out their but i recommend nusoap, haven't had any problems yet.

  4. #4
    VBA Nutter visualAd's Avatar
    Join Date
    Apr 2002
    Location
    Ickenham, UK
    Posts
    4,906

    Re: Opening $_GET urls?

    Look into using SOAP. PHP 5 has an extension and PEAR also has an implementation.
    PHP || MySql || Apache || Get Firefox || OpenOffice.org || Click || Slap ILMV || 1337 c0d || GotoMyPc For FREE! Part 1, Part 2

    | PHP Session --> Database Handler * Custom Error Handler * Installing PHP * HTML Form Handler * PHP 5 OOP * Using XML * Ajax * Xslt | VB6 Winsock - HTTP POST / GET * Winsock - HTTP File Upload

    Latest quote: crptcblade - VB6 executables can't be decompiled, only disassembled. And the disassembled code is even less useful than I am.

    Random VisualAd: Blog - Latest Post: When the Internet becomes Electricity!!


    Spread happiness and joy. Rate good posts.

  5. #5

    Thread Starter
    Addicted Member
    Join Date
    Jul 2005
    Posts
    236

    Re: Opening $_GET urls?

    Ok, thx.

    I thought that no rule was broken because it's just a simple HTTP request.

  6. #6
    I'm about to be a PowerPoster!
    Join Date
    Jan 2005
    Location
    Everywhere
    Posts
    13,647

    Re: [RESOLVED] Opening $_GET urls?

    Yuh, but it's an automated request.

Posting Permissions

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



Click Here to Expand Forum to Full Width