SQL PHP HTML ASP JavaScript articles and free scripts to download
 

Ajax PHP MySQL based progress bar

In applications where the main script takes time to execute the full code, we can have some break ups or some landmark points at some intervals. Once the execution completes these landmarks then it will update a table with status indicating the completion of the part. Our progress monitoring script will interact with this table to take the feedback and display the progress bar accordingly.

We have already seen how the progress bar is displayed. We will extend the same technique to show a growing status bar as per the script execution.

Here is the block diagram of the process.

progress-bar2.htm

There is not much difference in basic progress bar script and this.

progress-bar2.php

This page reads the data from the status table and returns the same to progress-bar2.htm through Ajax to display the progress bar image.

progress-bar2-1.php

This script first deletes all the records of the status table and then updates it with different stage values. To create some delays in script execution sleep() function is used. At the end of each stage the status table is updated.

Download the zip file for all these three scripts.



Further readings
Ajax & PHP scripts
Creating XMLHttp object in different browsers
Sample Code: Get Method of Ajax form submission
Dependant drop down list box using Ajax & PHP
Email validation using Ajax in a form
Getting customer details by entering customer id using Ajax
Progress Bar using Ajax
Progress Bar using MySQL PHP & Ajax
Displaying Message at client side using Ajax & PHP
Web page HTML form validation using Ajax and PHP
Form validation with onBlur event using Ajax and PHP

Json support in PHP
json_encode to generate Json string from PHP Array data
Json Data formatting to return database records to main script
Searching MySql database as we type using Ajax
Displaying all records based on selection of a drop down list box

Post Comment This is for short comments only. Use the forum for more discussions.
Name
Email( not to be displayed)Privacy Policy
1+2=This is to prevent automatic submission by spammers. Please enter the result of the sum as asked


Join Our Email List
Email:  
For Email Newsletters you can trust
Ajax & PHP
PHP Sections