I have a form that I would like to post to a secure site. This secure site will only respond to post from a <b>secure socket connection</b>! So, can any one point me in the right direction?? I've tried the following, but to no avail... What am I missing here??
<?php
$query1 = "username=".urlencode($username);
$query1 .= "&password=".urlencode($password)";
$query2 = "POST /secureconn/process.php HTTP/1.0\r\n";
$query2 .= ""Content-type: application/x-www-form-urlencoded\r\n";
$query2 .= "Content-length: " . strlen($query1) . "\r\n\r\n";
$fp = fsockopen("www.myserver.com",443,&$errno,&$errstr,30);
if ($fp) {
fputs($fp,$query2.$query1 );
$response = "";
while (!feof($fp)) {
$response .= fgets ($fp,1024);
};
}
print "response = $response<br>\n";
?>