Remote files that are too big (?) do not load correctly
Posted: Tue Aug 17, 2004 4:54 am
Problem: I want to include HTML generated by another web application inside a PHP page. I do it like this:
<?php
$url = "http://foo.bar?";
$url .= $_SERVER["QUERY_STRING"];
@readfile($url);
?>
Depending on the size of the returned HTML string (i.e. depending on the QUERY_STRING) there are three problems I encounter:
1. The $url is fetched many times (up to 20), looks like an automatic reload.
2. Sometimes the browser tells finally, that the whole PHP page (!) cannot be found (but when I use another QUERY_STRING, i.e. empty) the PHP page is there again)
3. The returned HTML is intermingled with strange characters: ?0M? which definitely don't come from the web application (at foo.bar). They appear each time at different positions.
N.B.: With small results (up to 4K) everything works perfect: no automatic reload, no "page not found", no strange characters.
Has anyone ever encountered this or a similar problem?
Thanks in advance
<?php
$url = "http://foo.bar?";
$url .= $_SERVER["QUERY_STRING"];
@readfile($url);
?>
Depending on the size of the returned HTML string (i.e. depending on the QUERY_STRING) there are three problems I encounter:
1. The $url is fetched many times (up to 20), looks like an automatic reload.
2. Sometimes the browser tells finally, that the whole PHP page (!) cannot be found (but when I use another QUERY_STRING, i.e. empty) the PHP page is there again)
3. The returned HTML is intermingled with strange characters: ?0M? which definitely don't come from the web application (at foo.bar). They appear each time at different positions.
N.B.: With small results (up to 4K) everything works perfect: no automatic reload, no "page not found", no strange characters.
Has anyone ever encountered this or a similar problem?
Thanks in advance