Scroll down as printing

Hi folks,

I am using this code to print the contents of a file

<?
....
while (!feof($file) ){
        $buffer = fgets($fp, 1024);
        print $buffer.'<br>';
        flush();
}


How can I scroll down the page as printing?

Thanks
bmbsaAsked:
Who is Participating?

[Webinar] Streamline your web hosting managementRegister Today

x
 
arataniConnect With a Mentor Commented:
Actually this is what you could try,

<?
....
while (!feof($file) ){
        $buffer = fgets($fp, 1024);
        print $buffer.'<br>';
        print "<script language = 'javascript'>window.scrollBy(0,50);</script>";
        flush();
}

You might have to change that value in the scrollBy function to get it right.

Take care

AJ
0
 
StormyWatersCommented:
PHP is a serverside language, so everything is done printing before the file ever gets to the user. I suppose you could scroll the page using javascript.
0
 
StormyWatersCommented:
Take a look at http://www.mediacollege.com/internet/javascript/page/scroll.html for a way to scroll the page in Javascript.
0
All Courses

From novice to tech pro — start learning today.