note 11470 modified in function.curl-setopt by danbrown

From: Date: Sun, 17 May 2009 17:39:03 +0000
Subject: note 11470 modified in function.curl-setopt by danbrown
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-155009@lists.php.net to get a copy of this message
If you want to connect to a secure server for posting info/reading info, you need to make cURL with the openSSL options. Then the sequence is nearly identical to the previous example (except http_S_://, and possibly add the useragent): <?php curl_setopt($ch, CURLOPT_URL,"https://example.com"); //some sites only accept your request if your browser looks legit, so send a useragent profile... curl_setopt ($ch, CURLOPT_USERAGENT, "Mozilla/4.0 (compatible; MSIE 5.01; Windows NT 5.0)"); ?> --was-- If you want to connect to a secure server for posting info/reading info, you need to make cURL with the openSSL options. Then the sequence is nearly identical to the previous example (except http_S_://, and possibly add the useragent): curl_setopt($ch, CURLOPT_URL,"https://secure.website.com"); //some sites only accept your request if your browser looks legit, so send a useragent profile... curl_setopt ($ch, CURLOPT_USERAGENT, "Mozilla/4.0 (compatible; MSIE 5.01; Windows NT 5.0)"); http://php.net/manual/en/function.curl-setopt.php

« previous php.notes (#155009) next »