I am using curl commands to read the data from an https page (https://forums.sdn.sap.com/forum.jspa?f ... 97&start=0).
When I run the php file, the file starts executing and the commands are echoed. But then I get transferred to the default homepage (https://www.sdn.sap.com/irj/scn).
Here's the code (which I copied from a website):
$ch=curl_init() or die(curl_error());
curl_setopt($ch, CURLOPT_HTTPAUTH, CURLAUTH_ANY);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, false);
curl_setopt($ch, CURLOPT_URL, 'https://forums.sdn.sap.com/forum.jspa?f ... 97&start=0');
curl_setopt($ch, CURLOPT_HEADER, 1);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_POST,1);
$data1=curl_exec($ch) ;//or die(curl_error());
echo $data1;
If I use the same code and replace the url with an HTTP one, it works.
Can anyone help?
Problem with using php and curl to access an HTTPS page
Moderator: General Moderators
Re: Problem with using php and curl to access an HTTPS page
Can anyone help? Please.