Har bixet lidt kode
$ReqBody = 'action=search&Titlefelt&GENRE=M3&country=2&hits=10&submit=Search';
$ContentLength = strlen($ReqBody);
$URI = '/test.php';
$Host = '127.0.0.1';
// Generate the request header
$ReqHeader =
"POST $URI HTTP/1.1\n".
"Host: $Host\n".
"User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; rv:1.7.3) Gecko/20041001 Firefox/0.10.1\n".
"Accept: text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5\n".
"Accept-Language: en-us,en;q=0.5\n".
"Accept-Encoding: gzip,deflate\n".
"Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7\n".
"Keep-Alive: timeout=15, max=100\n".
"Connection: keep-alive\n".
"Referer:
http://www.musicbrigade.com/playlists/playlist.asp?left=search.asp&menu=search&state=initial\n"."Content-Type: application/x-www-form-urlencoded\n".
"Content-Length: $ContentLength\n\n".
"$ReqBody\n";
// Open the connection to the host
$socket = fsockopen($Host, 80, &$errno, &$errstr);
if (!$socket) {
$Result["errno"] = $errno;
$Result["errstr"] = $errstr;
echo $Result;
}else{
$str ='';
$idx = 0;
fputs($socket, $ReqHeader);
while (!feof($socket)&&$idx<100){
$str.=fgets($socket, 128);
$idx++;
}
}
echo "<html><xmp>$str</xmp></html>";
det virker for saavidt udemaerket, men det taber bare utrolig lang tid at loade. Det er lige som om den ikke forst[r hvorn[r der ikke er mere fil. *den bliver bare ved med at vente (det er derfor jeg har sat $idx tjekket ind)
nogen ideer til hvorfor det g[r langsomt?