I would like to create a progress bar in php. Do you know to do that?
I would like to create a progress bar in php. Do you know to do that?
You mean during a download? (I don't know how but I figure that info would help others help you. My guess is you have to use Flash to do that, though.)
If you want to make a moving progress bar for something, you have to use some client-side scripting (javascript, flash, w/e) but not php
Real programmers don't document their code - if it was hard to write, it should be hard to understand.
I want to run a php script. While the php script is running it would appear a progress bar. For example if i have a flash progress bar how can i call it from the php script?
As marshian said, you need to use only client side scripts.. You can try Ajax + php progress bar also.. google for it and you can find so many info about it.
[LEFT][B]Sunil Sankar
-------------------------------------------------------------------------
BUT if the PHP script is running, nobody will be able to see the progress bar anyway.
You can show flash using the following:
But understand that the bar will not be seen until PHP has finished execution. PHP is a server side only language. Everything is done on the server, and the client only sees the results.Code:echo "<object width='400' height='100'> <param name='movie' value='flashbar.swf'> <embed src='flashbar.swf' width='40' height='100'> </embed></object>";
If anyone can see it, my post was meant for anyone who reads it. Don't take it personally or think I'm being condescending... :nuts:
Using ajax you can do that.. you have uploaders with progress bar which uses ajax technology. It uses the php code to upload the code and simultaneously shows the progress bar.
[LEFT][B]Sunil Sankar
-------------------------------------------------------------------------
You can do something like...
when the php script starts, set a session variable to 0 (0%)
while the php script runs, change that number (0 -> 100%)
meanwhile, ANOTHER PAGE shows the progress bar
using javascript it requests a 3rd php page which returns the session variable
again using javascript, the scrollbar is updated.
Example (in my-code = non-existing language)
do-something-page.php
pageThatIsCalledByJavascript.phpCode:$_SESSION["prog"] = 0; for(blahblah) { $_SESSION["prog"]++; }
statusbarPage.phpCode:echo $_SESSION["prog"];
Code:<html blahblah> <script> ProgressBar status = new ProgressBar(); status.value = 0; setTimeout(update, 1000); function update() { newstatus = getPageContents("pageThatIsCalledByJavascript.php"); status.value = newstatus; } </script>
<3 me-code ;p
- Marshian
Real programmers don't document their code - if it was hard to write, it should be hard to understand.