Charvusta Posted September 30, 2017 Share Posted September 30, 2017 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 More sharing options...
requinix Posted September 30, 2017 Share Posted September 30, 2017 A 302 is a redirect. Look into how cURL can handle redirections. Link to comment Share on other sites More sharing options...
Charvusta Posted September 30, 2017 Author Share Posted September 30, 2017 curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true); This worked, cheers again. Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.