curl problem

Discussion in 'PHP' started by PinoyIto, May 18, 2009.

  1. #1
    I have using curl for one my application but I found this problem, that sometimes it does not get anything from the target page.... It display blank...

    here is my code...
    
    $urls =  "http://www.facebook.com/pages/Seo-Tips-by-Peter-Drew-BruteForceSEO/86945032176";
    $ch = curl_init($urls);
    curl_setopt( $ch, CURLOPT_RETURNTRANSFER, 1 );
    curl_setopt( $ch, CURLOPT_HEADER, 0 );
    $page = curl_exec($ch);
    curl_close($ch);
    
    Code (markup):
    I hope I can light about this

    thanks in advance
     
    PinoyIto, May 18, 2009 IP
  2. JDevereux

    JDevereux Peon

    Messages:
    50
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    0
    #2
    If you set curlopt_header to true you may find out whats going on, whether you're getting bounced or what. I also usually use the following settings:

    curl_setopt($curl, CURLOPT_USERAGENT, $userAgent);
    curl_setopt($curl, CURLOPT_AUTOREFERER, true);
    curl_setopt($curl, CURLOPT_FOLLOWLOCATION, true);
    curl_setopt($curl, CURLOPT_TIMEOUT, 10 );
    PHP:
     
    JDevereux, May 19, 2009 IP
  3. Fareast

    Fareast Banned

    Messages:
    64
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #3
    try use file_get_contents

     
    Fareast, May 19, 2009 IP