RE: Re: [PHP] Creating SSL Connection to Accept Credit Cards

From: Date: Tue, 05 Nov 2002 18:09:37 +0000
Subject: RE: Re: [PHP] Creating SSL Connection to Accept Credit Cards
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-122822@lists.php.net to get a copy of this message
Except that https:// doesn't work with fopen until PHP 4.3.0. Suggestions are only good if they work with a current version of PHP. :) (No, I don't consider 4.3.0 current until it's at *least* released) Regardless, until then, CURL support is probably the way to go. Assuming you have curl support, it's fairly straightforward: --- $ch = curl_init("https://somesite.com"); curl_setopt($ch, CURLOPT_HEADER, 0); curl_setopt($ch, CURLOPT_POST, 1); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); curl_setopt($ch, CURLOPT_POSTFIELDS, $authorization_data); $result = curl_exec($ch); $errorstr = curl_error($ch); curl_close($ch); --- $result contains the data received and $errorstr contains the error message (if any) if it was unsuccessful. Translating $result depends on how they return the data. With the above example, you'll need to have $authorization_data in POST format, which really is nothing more than the GET format string. (Secure transaction APIs typically don't allow GET) var=somevalue&var2=somevalue2&var3=anothervalue > -----Original Message----- > From: Ben C. [mailto:benc@cox.net] > Sent: Tuesday, November 05, 2002 11:55 AM > To: Adam Voigt > Cc: php-general@lists.php.net > Subject: Re: Re: [PHP] Creating SSL Connection to Accept Credit Cards > > > I am not sure if that is what they want. I will try it and > get back. Good suggestion. > > > > From: Adam Voigt <adam@cryptocomm.com> > > Date: 2002/11/05 Tue PM 12:33:00 EST > > To: benc@cox.net > > CC: php-general@lists.php.net > > Subject: Re: [PHP] Creating SSL Connection to Accept Credit Cards > > > > Like: > > > > $f = fopen("https://whatever.com","r")

« previous php.general (#122822) next »