The script below is working fine for me:

$data2send = "field1=value1&field2=value2";

$ch = curl_init();

curl_setopt($ch, CURLOPT_URL,"https://www.postside.com/postpage";);
curl_setopt($ch, CURLOPT_RETURNTRANSFER,1);
curl_setopt ($ch, CURLOPT_USERAGENT, "Mozilla/4.0 (compatible; MSIE 5.01;
Windows NT 5.0)");
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
curl_setopt($ch, CURLOPT_REFERER, "https://www.yoursite.com/";);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, $data2send);
$result=curl_exec ($ch);
curl_close ($ch);

You can find meanings of options at:
http://www.php.net/manual/en/function.curl-setopt.php

Some guidelines for options:
USERAGENT is sometimes necessary on some sites as they do not let you
connect if your browser is not known.
FOLLOWLOCATION is necessary for following redirects on posting page.

You can find others easily.

Yours,

--
Tolga 'thorr' Orhon

"Todd Cary" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> I need to send a POST string to a HTTPS server and receive the returned
> string.  Does anyone know the correct syntax for this?  I have looked at
> the HELP a www.php.net; however, I am not completely clear on what I
> need to put into the curl_setopt().
>
> Todd
>
> --
> Todd Cary
> Ariste Software
> [EMAIL PROTECTED]
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
>



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to