1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24
|
<?
$proxy = "...";
$port = ...;
$login = "...";
$passwd = "...";
$url = "http://search.yahoo.com/search";
$fp = fsockopen($proxy, $port);
if ($fp) {
$post_var = urlencode('p=test');
$request = "POST $url HTTP/1.1\r\n
Host: $proxy\r\n
Content-Length: ".strlen($post_var)."\r\n
Content-Type: application/x-www-form-urlencoded\r\n
Proxy-Authorization: Basic".base64_encode("$login:$passwd")."\r\n
Connection: Close\r\n".$post_var."\r\n";
fputs ($fp, $request);
while (!feof($fp)) echo fgets ($fp,4000).'<br />';
} // end if ($fp)
fclose ($fp);
?> |
Partager