note 27864 added to function.fopen
| From: | (thoughtabout) | Date: | Sat, 21 Dec 2002 14:08:40 +0000 |
| Subject: | note 27864 added to function.fopen | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-41182@lists.php.net to get a copy of this message | ||
To access files through a proxyserver which needs authentification use Curl:
http://www.php.net/manual/en/ref.curl.php
Example code:
$url = "http://your.adress.com/bla/bla?bla=bla";
$user_agent = "Opera rulez";
$proxyname = "AdressOfProxy";
$proxyport = "PortOfProxy";
$username = "ProxyUserName";
$userpassword = "ProxyUserPassword";
$ch = curl_init();
curl_setopt ($ch, CURLOPT_URL, $url);
curl_setopt ($ch, CURLOPT_USERAGENT, $user_agent);
curl_setopt ($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt ($ch, CURLOPT_TIMEOUT, 10);
curl_setopt ($ch, CURLOPT_PROXY, "$proxyname:$proxyport");
curl_setopt ($ch, CURLOPT_PROXYUSERPWD, "$username:$userpassword");
$result = curl_exec ($ch);
curl_close ($ch);
echo $result;
--
http://www.php.net/manual/en/function.fopen.php
http://master.php.net/manage/user-notes.php?action=edit+27864
http://master.php.net/manage/user-notes.php?action=delete+27864
http://master.php.net/manage/user-notes.php?action=reject+27864