?
Solved

Scroll down as printing

Posted on 2004-08-14
3
Medium Priority
?
176 Views
Last Modified: 2006-11-17
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
0
Comment
Question by:bmbsa
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 13

Expert Comment

by:StormyWaters
ID: 11802137
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
 
LVL 13

Expert Comment

by:StormyWaters
ID: 11802194
Take a look at http://www.mediacollege.com/internet/javascript/page/scroll.html for a way to scroll the page in Javascript.
0
 
LVL 4

Accepted Solution

by:
aratani earned 180 total points
ID: 11802670
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

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Things That Drive Us Nuts Have you noticed the use of the reCaptcha feature at EE and other web sites?  It wants you to read and retype something that looks like this. Insanity!  It's not EE's fault - that's just the way reCaptcha works.  But it i…
These days socially coordinated efforts have turned into a critical requirement for enterprises.
The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.
The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …
Suggested Courses

765 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question