0

how to create a progress bar using php output buffering and jquery?

i been searching this for weeks,

i am desperate to learn this, this is a very big help for me, is someone the here share some codes?

i know the this will need to script. i have tried sereval code for my client side script:

var request = new XMLHttpRequest();
request.addEventListener("progress", updateProgress, false);

function updateProgress(e) {
var percent = (e.loaded / e.total) * 100;
 /** update the with of the progress bar **/
}

and to my server side, i dont know how. but actually i want to use this for a mysql query so that i can see the progress of my query and another thing is i dont know how to use output buffering.

somebody help me on this please.

4

1 回答 1

0

有一些方法可以实现这一点

1) 使用 PHP APC,iframe,Jquery

2) 闪存文件

3) CGI 脚本

您可以尝试前两种,这里是第二种方法的文章,可以让您更清楚

http://pixeline.be/experiments/jqUploader/test.php

下面是第一种方法的文章,但是第一种方法你需要在你的服务器上配置 PHP APC 它就像输出缓冲

http://www.johnboy.com/php-upload-progress-bar/

于 2012-09-20T08:44:51.890 回答