While we're on the subject of cURL...
I found the following page on ZEND's site that discusses using cURL with PHP in regards to HTTP authentication but it's not working form me (I'm doing my script calls from the command-line.
Their code:
<?php
// HTTP authentication
$url = "http://www.example.com/protected/";
$ch = curl_init();
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_USERPWD, "myusername:mypassword");
$result = curl_exec($ch);
curl_close($ch);
echo $result;
?>
My code:
<?php
// HTTP authentication request via cURL
$ch = curl_init();
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_URL, "http://" . $REQUEST['ip'] . "/" . $REQUEST['page']);
curl_setopt($ch, CURLOPT_USERPWD, $REQUEST['user'] . ":" . $REQUEST['pass']);
$result = curl_exec($ch);
curl_close($ch);
echo $result;
exit;
?>
My code turns the various elements into passable parameters called ip, page, user, and pass.
When I run this from the command line (with parameters), the shell window instantly goes from foreground (zorder=0) to background (wierd) and nothing is return in the $result (nothing is output in the echo).
Any ideas?
Thanks again for all the help