Jump to content


Photo

loading screen, possible?


  • Please log in to reply
4 replies to this topic

#1 Jocka

Jocka
  • Members
  • PipPipPip
  • Advanced Member
  • 344 posts
  • LocationDallas, Texas

Posted 14 August 2006 - 04:20 AM

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.

#2 Kris

Kris
  • Staff Alumni
  • Advanced Member
  • 2,755 posts
  • LocationThe Internet

Posted 14 August 2006 - 11:51 AM

You'll need something like JavaScript for this, maybe even using an Ajax technique.

#3 Jocka

Jocka
  • Members
  • PipPipPip
  • Advanced Member
  • 344 posts
  • LocationDallas, Texas

Posted 14 August 2006 - 04:10 PM

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

#4 GingerRobot

GingerRobot
  • Staff Alumni
  • Advanced Member
  • 4,086 posts
  • LocationUK

Posted 14 August 2006 - 07:35 PM

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.

#5 ylkien

ylkien
  • Members
  • PipPip
  • Member
  • 11 posts

Posted 06 December 2006 - 10:48 AM

if flush() doesn't work, try

ob_flush();
flush();




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users