HTTPS post request with CURL

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

rmk
Forum Newbie
Posts: 9
Joined: Wed Jul 16, 2003 3:04 pm

Post by rmk »

You were right. No cerficates was needed. This is the "magic" line which do the trick :)

curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);

Here is the whole script :

$data = "AccountID=xxxxxx&PassPhrase=xxxxxxx&Payee_Account=xxxxxx&Amount=0.01&Memo=theMemo&PAY_IN=1&WORTH_OF=Gold&IGNORE_RATE_CHANGE=y";

$ch = curl_init("https://www.e-gold.com/acct/confirm.asp");
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, $data);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
curl_exec($ch);
curl_close($ch);

If you are trying to make a POST ot GET on the main page - http://www.e-gold.com, there is nothing to do with HTTPS.

Thanks for all your help !!!
rmk
Forum Newbie
Posts: 9
Joined: Wed Jul 16, 2003 3:04 pm

Post by rmk »

By the way I was reading for this option (CURLOPT_SSL_VERIFYPEER) in another forum, but there is nothing mentioned in the php 4.3.2 documentation. Strange ... ?!?!?
Post Reply