Hi,
I am trying to -
1. connect to an https server
2. execute a cgi program in a particular path on that server
3. get back the response produced by that cgi
Here is the code that I am using -
/**httpsGet.php
$fp = fsockopen ("$servername", 443, &$errno, &$errstr, 30);
if (!$fp) {
echo ($errno)<br>\n";
} else {
$enc = base64_encode("$username:$password");
$query = "GET /cgi-bin/filename.cgi?$otherQueries HTTP/1.0\r\n\nAuthorization: Basic ".$enc."\r\nHTTPS: on\r\nConnection: Close\r\n\r\n";
fputs ($fp,$query);
while (!feof($fp))
echo fgets($fp, 128);
fclose ($fp);
}
****/
See, I am and want to execute this code not from the browser and don't want to get the Authentication prompt from the https server, but in the linux background. Ofcourse you can do this by typing (One of you out there has given me this this idea - Derek)https://userid:passwd@servername/cgi-bin/filename.cgi?query - and you can very well avoid the Authentication prompt.
When I try 'php httpsGet.php' (Hoping to use a popen command) from linux prompt, it executes without any error but dosen't perform the actual GET operation and dosen't give any output. Any one of you out there can help me to solve this problem.....
Thanks and Regards
Deepesh