I'm trying to read the page
https://mpl-rdp-irm.mtn-park-lodges....\&IRMResort=02
but having little luck. as it seems like the connect returns Success
(0) instead of letting me read the page...
Any ideas?
$host = "mpl-rdp-irm.mtn-park-lodges.com";
$port = 443;
$path = "/irm/default.asp";
//you will need to setup an array of fields to post with
//then create the post string
$formdata["IRMPath"] = "\\\\mplLobstick\rdpnt\rdp\"";
$formdata["IRMResort"] = "02";
//build the post string
foreach($formdata AS $key => $val){
$poststring .= urlencode($key) . "=" . urlencode($val) . "&";
}
// strip off trailing ampersand
$poststring = substr($poststring, 0, -1);
$fp = fsockopen("ssl://".$host, $port, $errno, $errstr, $timeout = 30);
if(!$fp){
//error tell us
echo "$errstr ($errno)\n";
echo "\nThis is printing success $fp ";
}else{
//send the server request
fputs($fp, "POST $path HTTP/1.1\r\n");
fputs($fp, "Host: $host\r\n");
fputs($fp, "Content-type: application/x-www-form-urlencoded\r\n");
fputs($fp, "Content-length: ".strlen($poststring)."\r\n");
fputs($fp, "Connection: close\r\n\r\n");
fputs($fp, $poststring . "\r\n\r\n");
//loop through the response from the server
while(!feof($fp)) {
echo "<BR>line: " . fgets($fp, 4096);
}
//close fp - we are done with it
fclose($fp);
}