Ja. Du schreibst dir einen Mini transparenten Proxy, in etwa so:
PHP-Code:
/*
FUNCTION: string html_send_data
SYNOPSIS: html_send_data(string $host, string $method, string $path,
mixed $data [, int $encode] [, int $port] [, int $useragent])
DESCRIPTION:
Sends data to a host just like being submitted by a HTML-form.
Params:
$host - Just the hostname. No http:// or /path/to/file.html portions
$method - get or post, case-insensitive
$path - The /path/to/file.html part
$data - The query string, without initial question mark or a
associative array. If $data is an int indexed array,
the sent data-string will have empty values.
$encode - Works only if $data is an array
$port - The server port of $host. Default is 80.
$useragent - If true, 'MSIE' will be sent as
the User-Agent (optional)
EXAMPLES:
print html_send_data('www.google.com','get','/search','q=php_imlib');
print html_send_data('www.example.com','post','/some_script.cgi',
'param=First+Param&second=Second+param', 0, 7788);
print html_send_data('www.somehost.com','post','/register.cgi',
array("user_id"=>"some.user"), 1);
*/
function html_send_data($host,$method,$path,$data,$encode=1,$port=80,$useragent=0)
{
if (empty($method))
$method = 'GET';
$method = strtoupper($method);
if (is_array($data) && sizeof($data)) {
$d="";
foreach ($data as $k=>$v) {
if (is_int($k)) {
$ek=$v;
$ev="";
} else {
$ek=$k;
$ev=($encode ? urlencode(stripslashes($v)) : $v);
}
$d.="$ek=".$ev."&";
}
$data=substr($d,0,-1);
}
if ($method == 'GET')
$path .= '?' . $data;
/*
print ("[b]Ausführung von html_send_data mit folgenden Parametern:[/b]
");
print ("[b]host:[/b] $host
");
print ("[b]method:[/b] $method
");
print ("[b]path:[/b] $path
");
print ("[b]data:[/b] $data
");
print ("[b]encode:[/b] $encode
");
print ("[b]port:[/b] $port
");
*/
$fp = fsockopen($host,$port);
fputs($fp, "$method $path HTTP/1.1\n");
fputs($fp, "Host: $host\n");
fputs($fp, "Content-type: application/x-www-form-urlencoded\n");
fputs($fp, "Content-length: " . strlen($data) . "\n");
if ($useragent)
fputs($fp, "User-Agent: MSIE\n");
fputs($fp, "Connection: close\n\n");
if ($method == 'POST')
fputs($fp, $data);
while (!feof($fp))
$buf .= fgets($fp,128);
fclose($fp);
return $buf;
}
P.S. Nicht lachen bitte, ist ein seeehr alter Code von mir
