Https
| From: | Ryan Sexton | Date: | Wed, 11 Oct 2000 04:22:14 +0000 |
| Subject: | Https | ||
| Groups: | php.windows | ||
| Request: | Send a blank email to php-windows+get-3124@lists.php.net to get a copy of this message | ||
Hello,
I'm having problems with using fsockopen to post to an httpS site. i'm
using port 443, and all I'm getting is a very long very very long pause. I'm
trying to write a small script out to work with authorizenet/creditcard
transactions and i can't establish a secure connection, i assumed that i
could with fsockopen, but all i get is a pause and after awhile it just
gives me a timeout error. Has anyone found a way to get this working? maybe
i'm doing something wrong, heres my script:
---------------------------------------------------------codestart:
$fp = fsockopen("www.domain.com", 443);
if($fp){
$request_form= "x_ADC_Delim_Data=TRUE";
$header = "POST /file.html HTTP/1.0\r\n";
$header .= "User-Agent: php-authorizenet-validator-HTTP_POST/1.0 \r\n";
$header .= "Content-type: application/x-www-form-urlencoded\r\n";
$header .= "Content-length: " . strlen($request_form) . "\r\n\r\n";
fputs($fp, $header . $request_form);
while (!feof($fp)) { $response_form .= fgets($fp, 128); }
fclose($fp);
}
---------------------------------------------------------codeend:
So i've got it down to the while statement, when i attempt to try and output
the returned data, it fails. am i approaching this wrong since it's ssl? any
help would be greatly appreciated.
Ryan Sexton
rsexton@buckeye-express.com
ps. I'm sorry if i'm covering an old topic, I am new to this group, please
accept my appologies if i haven't done my homework enough.