problem with fsockopen and stream_get_line
Posted: Fri Oct 16, 2009 11:16 am
ok my code is something like this
problem is it works great, but there is data in there that is not in the original source of the website it is looking at.
for example part of the original source looks like
but when i look at it using the above function
not exactly the same, it throws 5FF4's in a couple times a page, always in the same places. any ideas why?
thanks
kyle
Code: Select all
function getpage($conn, $page)
{
$fp = fsockopen($conn, 80, $errno, $errstr, 30);
if (!$fp) {
echo "$errstr ($errno)<br />\n";
} else {
$out = "GET ".$page." HTTP/1.1\r\n";
$out .= "Host: ".$conn."\r\n";
$out .= "Content-type: text/html\r\n";
$out .= "Connection: Close\r\n\r\n";
fwrite($fp, $out);
while (!feof($fp))
{
$buffer = stream_get_line($fp, 1024, "\n");
echo $buffer;
}for example part of the original source looks like
Code: Select all
class="tBox">24but when i look at it using the above function
Code: Select all
class="tB
C
ox"> 2
5FF4
4 thanks
kyle