l0ve2hat3 Posted March 14, 2008 Share Posted March 14, 2008 i have a progress bar but it echos the percent after the loop is done. is there anyway to make it update as the progress updates?? <? $i=0; while($i < 100){ $i++; usleep(50000); echo "||"; flush(); ob_flush(); } echo "<br>".$i."%"; ?> Link to comment https://forums.phpfreaks.com/topic/96075-help-with-echo/ Share on other sites More sharing options...
soycharliente Posted March 14, 2008 Share Posted March 14, 2008 I've tried doing that with PHP as well and I could never get it working either. I ended up using Javascript with no progress bar if they didn't have JS enabled. Because AFAIK, PHP will run completely before returning information to the browser for rendering. Link to comment https://forums.phpfreaks.com/topic/96075-help-with-echo/#findComment-491873 Share on other sites More sharing options...
l0ve2hat3 Posted March 14, 2008 Author Share Posted March 14, 2008 thanks Link to comment https://forums.phpfreaks.com/topic/96075-help-with-echo/#findComment-491886 Share on other sites More sharing options...
l0ve2hat3 Posted March 14, 2008 Author Share Posted March 14, 2008 actually how could i do it with javascript? or should i ask in another forum Link to comment https://forums.phpfreaks.com/topic/96075-help-with-echo/#findComment-491889 Share on other sites More sharing options...
soycharliente Posted March 14, 2008 Share Posted March 14, 2008 I lied actually. I did make it work with PHP. Where can I attach a file at? Link to comment https://forums.phpfreaks.com/topic/96075-help-with-echo/#findComment-491894 Share on other sites More sharing options...
derrick1123 Posted March 14, 2008 Share Posted March 14, 2008 I think you should ask on the other forum, you will probably get good results with people who know a little bit more about javascript than people who are here that would only know a little about javascript and a lot about PHP. (in which this is my case lol ) BTW, ajax would seem the way to go in your situation. Link to comment https://forums.phpfreaks.com/topic/96075-help-with-echo/#findComment-491895 Share on other sites More sharing options...
soycharliente Posted March 14, 2008 Share Posted March 14, 2008 I made it work in PHP. I have code. I PM'd you love2hate. Link to comment https://forums.phpfreaks.com/topic/96075-help-with-echo/#findComment-491897 Share on other sites More sharing options...
l0ve2hat3 Posted March 14, 2008 Author Share Posted March 14, 2008 thank you! Link to comment https://forums.phpfreaks.com/topic/96075-help-with-echo/#findComment-491899 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.