Jump to content

302 error with a curl to an https


Charvusta

Recommended Posts

This is my function, which works when i have a website that is just http.

any ideas? I'm on localhost at home.

Cheers

function visitDomainPage(){
        
        
    $curl = curl_init();
    curl_setopt ($curl, CURLOPT_URL, "https://www.google.com");
    curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);
        
    curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, FALSE);
    curl_setopt($curl, CURLOPT_SSL_VERIFYHOST,  2);

    $result = curl_exec ($curl);
    curl_close ($curl);
    print $result;
        
    }
Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.