I would like to create a pure PHP progress bar without the use of jQuery and Ajax.
I found this pure PHP progress code from here stackoverflow.com
<?php
// Output a 'waiting message'
echo 'Please wait while this task completes';
// Now while waiting for a certain task to
// complete, keep outputting .'s
while (true) {
// Echo an extra dot, and flush the buffers
// to ensure it gets displayed.
echo ' .';
flush();
// Now sleep for 1 second and check again:
sleep(1);
}
?>
My other PHP basically converts an image to a thumbnail. Basically a 3MB image takes around 5 to 6 seconds to convert it to a thumbnail.
I am not sure where to insert my php thumbnail image resize code. I tried and entered it here but it didn't work.
while (true) {
// Echo an extra dot, and flush the buffers
// to ensure it gets displayed.
echo ' .';
I am still a newbie so please forgive my bliss.
UPDATE
This is my other image resize code:
<?php
$image01 = 'http://292fc373eb1b8428f75b-7f75e5eb51943043279413a54aaa858a.r38.cf3.rackcdn.com/eac44780278d69bc98130acce093fff64214606285-1408631133-53f6015d-620x348.jpg';
$image02 = 'http://upload.wikimedia.org/wikipedia/commons/3/39/American_soldiers_watch_as_the_Tricolor_flies_from_the_Eiffel_Tower_again.jpg';
// read page 1
$im = new imagick($image02);
// convert to jpg
$im->setImageFormat('jpeg');
//resize
$im->resizeImage(600, 350, imagick::FILTER_LANCZOS, 1, TRUE);
//write image on server
$im->writeImage('thumb.jpg');
$im->clear();
$im->destroy();
echo '<img src="thumb.jpg"/>';
?>