Jump to content

Archived

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

Jocka

loading screen, possible?

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.

Share this post


Link to post
Share on other sites
You'll need something like JavaScript for this, maybe even using an Ajax technique.

Share this post


Link to post
Share on other sites
I'm thinking I can just make it do it set by an "average" load time based on connection speed..

It won't be completely accurate but it'll be close

Share this post


Link to post
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.

Share this post


Link to post
Share on other sites

×

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.