PHP Curl

Discussion in 'PHP' started by lhornaday, Sep 18, 2013.

  1. #1
    I am having problems with curl on a particular site that uses javascript cookies. I cant get the page contents, only a javascript error message is returned. Is there a workaround? Maybe a way to set the needed cookie file before loading the page?

    Code being used:
    $ch = curl_init();
    curl_setopt($ch, CURLOPT_URL,'http://www.woothemes.com');
    curl_setopt($ch,CURLOPT_RETURNTRANSFER,1);
    $results = curl_exec($ch);
    echo $results;
    PHP:
    Site is: http://www.woothemes.com

    Thanks
     
    lhornaday, Sep 18, 2013 IP
  2. sarahk

    sarahk iTamer Staff

    Messages:
    28,897
    Likes Received:
    4,555
    Best Answers:
    123
    Trophy Points:
    665
    #2
    Have you asked them?
    There may be another way you can pick up the content you need from them.
     
    sarahk, Sep 18, 2013 IP
  3. bartolay13

    bartolay13 Active Member

    Messages:
    735
    Likes Received:
    14
    Best Answers:
    1
    Trophy Points:
    98
    #3
    can you post any logs from browser or server
     
    bartolay13, Sep 18, 2013 IP
  4. samyak

    samyak Active Member

    Messages:
    280
    Likes Received:
    7
    Best Answers:
    4
    Trophy Points:
    90
    #4
    Since all you seemed to need is the HTML content, i tried this:
    echo file_get_contents('http://www.woothemes.com/');
    PHP:
    But this didn't work either. It worked for all other websites but not this one. I think they are blocking it somehow.
     
    samyak, Sep 18, 2013 IP