cgm Posted September 19, 2008 Share Posted September 19, 2008 Hey folks.... I have a script that downloads an HTML page, but for some reason I get random characters appearing every now and then, generally 3 or 4 random alphanumeric characters surrounded by newlines. The most obvious (for me anyway) in the page that is being loaded by the script below is: <a href="http://www.promo-so b55 urcing.net"><strong>www.p.... The new lines and "b55" are not there when I view the page or get the whole file in one go, only when I try getting the file in bits. Script as follows: $fp = @fsockopen("www.buyking.co.uk", 80, $errno, $errstr, 30); $header = "GET / HTTP/1.1\r\n". "Host: www.buyking.co.uk\r\n". "User-Agent: Mozilla/4.0 (compatible; MSIE 5.01; Windows NT 5.0)\r\n". "Accept: */*\r\n". "Connection: close\r\n". "Referer: http://www.buyking.co.uk/\r\n\r\n"; fputs($fp, $header); $buffer = fgetc($fp); $response = ""; while (!feof($fp)) { $response .= $buffer; $buffer = fgetc($fp); } $response .= $buffer; echo $response; Thanks in advance for any suggestions, Chris Link to comment https://forums.phpfreaks.com/topic/124935-random-characters-appearing-in-content-from-a-url/ Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.