Jump to content

loading screen, possible?


Jocka

Recommended Posts

Is there a way to do this in PHP, if there is then I'm not that educated in PHP yet lol. I'm sure it requires JAVASCRIPT too if it is infact possible.

I could have swore there was a small tutorial on here somewhere but I couldn't find one.

Is there a way to do this. I want to do it for those LONG database searches, so it shows the users "It's almost done" lol. Just something "neat" to look at really. I don't need it but I'd like to have it.
Link to comment
https://forums.phpfreaks.com/topic/17470-loading-screen-possible/
Share on other sites

Well, i *think* you do it using flush()...

<?php

for ($i = 0; $i<10; $i++){
echo " Line $i<br />";
flush();
sleep(1);
}

echo "Done.";

?>

Run that and you will notice that it doesn't wait for the script to finish to output the data. So, i believe you can echo things to the browser at strategic points and then use flush().

I am using sleep() to simulate a long script here.
  • 3 months later...

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.