Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Scroll down as printing

Posted on 2004-08-14
3
Medium Priority
?
179 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

Tech or Treat!

Submit an article about your scariest tech experience—and the solution—and you’ll be automatically entered to win one of 4 fantastic tech gadgets.

Question has a verified solution.

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

This article discusses how to implement server side field validation and display customized error messages to the client.
There are times when I have encountered the need to decompress a response from a PHP request. This is how it's done, but you must have control of the request and you can set the Accept-Encoding header.
The viewer will learn how to dynamically set the form action using jQuery.
The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.
Suggested Courses

593 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