Charvusta Posted September 30, 2017 Share Posted September 30, 2017 (edited) 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; } Edited September 30, 2017 by Charvusta Quote 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. 1 Quote 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. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.