Many ways to create a progress bar but in this blog post I give example on PHP Progress bar built with OOP.
The reason I use OOP is that the class can be used again for any purpose which need progress bar.
We need interface OOP object which contains three methods which are
get_max() returns maximum value that progress bar will have,
get_progress() returns current progress value or progress percentage. This progress percentage value sets progress bar value and
do_work() to do a real work like database or files operation or else.
I use JQuery to draw Progress Bar in User Interface because of simplicity to make it with JQuery. I assume that you already know basic of progress bar and JQuery.