File: sample5.php

Recommend this page to a friend!
  Classes of Tom Schaefer  >  Script Progress  >  sample5.php  >  Download  
File: sample5.php
Role: Example script
Content type: text/plain
Description: with image
Class: Script Progress
Flush page output to show progress of server task
Author: By
Last change: bug fix
Date: 8 years ago
Size: 1,939 bytes
 

Contents

Class file image Download
<?php

include_once 'class.php';

/**
 * eight steps, each sleeps for 1 sec
 */
$buff = new ScriptProgress(8, 1000000);

# put some styles and a div-tag ahead
$buff->set("<style>div{margin:2px;border:none;background:transparent url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAAadEVYdFNvZnR3YXJlAFBhaW50Lk5FVCB2My41LjEwMPRyoQAAAklJREFUOE+tkl9oUmEYxl9dWZKaf5Yt6Y8dyUG2bkZFsbbE0UA4a0nURsOg7sKr7qPutqCbLoJgi0Y03WrZRVsEG57GLNfChaizLS/U44Wgt+fgjby936l5GMiu+uAHD8/7Ps/3HTgA//2EbQ54aw3BjC0Ms+1xBaaZx2a7nmkbr5tzCGcTXpH/HZRGSvcbwwS/FZTOfLsishnQTuuO1zbeGHUm+c2gHNi6h4Mbd7AvMaTA9PXNu+j/NSob5k4kgXZ3lkzqHbrwEcG/cVse+DmMV9dv4cVlP24fppnHZv2pm/Le6Q4BKKOWTJhDnliP6PtxAy9/HVToXuxvFjC97Xu/B9D1+ZwIlFELXpgjfWtD0vnYAHYt9Cq4oxewWq1iqVTC9pen0DrhUrC/6kTuQ7cElFELnh+Me9cCDc/HHqzX61gsFjGbzWIul8N8Po+FQgHL5TJWKhW0THHomPU0gDJqwTNTvDdxrUHNmMlkMJ1OtwzXajW0hDm0v+9sAGXUgqfGyOmlS5J13oWWGe4vb7jmzUw3/XkOzVGnBJRRC8YPhCyRk+KhL260xGiZscCpzybd9Gm2f8ouAmXUgkd6h/aJSbALbtm6Sq9YpcASp3yz8mzSikeYFo/LmnGDAJTZ+S881PNtY8akecUpW1NUkqLAp38wTZiWj8naMUMSaLf13xho4zUPdMK+SYtoXDkqmdPOBoNp5rEZ0E6r8B4yDxMesIMPfJrHMKJ5B6OauALTzGMzgC6ig2CZ5tGSMhB2gn3bbrCL2C7LwB+522LfRu8FEAAAAABJRU5ErkJggg==);display:inline-block;width:16px;height:16px;}</style><div></div>");
# do some stuff here
$buff->next();


# second div
$buff->set("<div></div>");
# do some stuff here
$buff->next();

# third div
$buff->set("<div></div>");
# do some stuff here
$buff->next();

$buff->set("<div></div>");
# do some stuff here
$buff->next();

$buff->set("<div></div>");
# do some stuff here
$buff->next();

$buff->set("<div></div>");
# do some stuff here
$buff->next();

$buff->set("<div></div>");
# do some stuff here
$buff->next();

$buff->set("<div></div>");
# do some stuff here
$buff->next();


# end operation
$buff->set("<br>done");
# do some stuff here
$buff->next();


For more information send a message to info at phpclasses dot org.