| home | forums | resources | search | news | join | members: 6057 |
Carl | Sat, 2007-09-01 07:48 tags: Developer Zone, PHP, Tutorials I needed a very simple progress indicator for a PHP migration script. Most of the ones I saw on the web were too involved. So I wrote a little snippet that writes to the page using javascript. Place the following PHP at the end of the while loop or whatever iterating process and the script will change the inner.HTML of a tag on the page. I used a dash so it grows from one character to four then resets. This provides the cute little animation that seems to hold every web developers attention for hours on end. Of course I could make this more involved by adding in a bunch of changable variables and fancy characters. But I leave it up to those that like that kind of stuff to do it and post the changes here if they like.
<html><title></title><head></head>
<?php
</body></html>
The nice thing about doing a PHP progress indicator this way rather than with a animated gif is that you get an idea of how long the code takes to run through each loop. Since I am doing a migration of a previous website over to Drupal I want to be able to see if the loop hangs on a process or if a particular row of information takes more time to finish. I left in the div tag indicator code for those that want to have a colored progress idicator. Lastly, this is not a progress bar. The difference between the two being that a progress bar show the amount of work done and how much until completion. A progress indicator just shows that something is happening. Much like the indicator used in a web browser to show that a page is loading. With ten years of experience in web development he spends most of his work day developing in PHP,mySQL and Drupal Carl McDade - Systems Developer |
Wordpress London Hotels
Web Developers Laptop Reviews
Web Developers Just Dial International Calls
Silverlight Excel Training Courses
Drupal excel courses in london
Silverlight Data Recovery
Drupal Cheap Personal & Secured Loans
Content Management Systems Sell Online
|
||||||
NewsletterGet updates on Hiveminds services, articles and downloads by signing up for the newsletter. |
Editor's choiceSome of the better articles, stories and tutorials found at Hiveminds. |
Find moreFind more of Hiveminds articles, stories, tutorials and user comments by searching. |
Picked linksHand picked websites and articles from around the web that provide quality reading. |