cURL / Mailing Lists / curl-and-php / Single Mail

curl-and-php

Re: anybody know how to open an https page?

From: Steve Yeazel <syeazel_at_frigidfluidco.com>
Date: Fri, 27 Feb 2004 12:34:21 -0600

At 11:00 AM 2/27/2004, you wrote:
>The following code doesn't work.
>
><?php
>$ch = curl_init ("https://maysportal.tamu.edu/bo.php");
>
>curl_setopt($ch, CURLOPT_VERBOSE, 1);
>curl_setopt($ch, CURLOPT_HEADER, 1);
>curl_setopt($ch, CURLOPT_FOLLOWLOCATION,1);
>curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
>curl_setopt($ch, CURLOPT_POSTFIELDS, $formvars);
>
>// perform post
>$rr=curl_exec($ch);
>echo $rr;
>curl_close($ch);
>?>

try this:

<?php
$url = "https://maysportal.tamu.edu/bo.php";
$ch = curl_init ();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_VERBOSE, 1);
curl_setopt($ch, CURLOPT_HEADER, 1);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION,1);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, $formvars);

// perform post
$rr=curl_exec($ch);
echo $rr;
curl_close($ch);
?>
Received on 2004-02-27