cURL is not working

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • forPHP
    New Member
    • Jul 2007
    • 3

    cURL is not working

    why i am not getting the page 'http://www.gmail.com'
    [PHP]<?php
    // create a new curl resource
    $ch = curl_init();

    // set URL and other appropriate options
    curl_setopt($ch , CURLOPT_URL, "http://www.gmail.com/");
    curl_setopt($ch , CURLOPT_FOLLOWL OCATION, true);
    curl_setopt($ch , CURLOPT_HEADER, 1);
    // grab URL, and print
    curl_exec($ch);
    ?>[/PHP]

    But it is working quiet good with 'http://www.google.com'
  • mwasif
    Recognized Expert Contributor
    • Jul 2006
    • 802

    #2
    Did you try to open anyother site? You need to set user-agent, accept cookies and ready to go for SSL. Use curl_setopt() to set these options. Consult the user comments in the above provided link.

    Comment

    Working...