Jump to content


Photo

sleep() controll


  • Please log in to reply
6 replies to this topic

#1 redarrow

redarrow
  • Members
  • PipPipPip
  • Advanced Member
  • 7,308 posts
  • Locationlondon

Posted 02 July 2006 - 01:31 PM

i thort this but dosen work first show an animated pic then echo message.


<?php

sleep(2);


$img="<img src='images/x.gif'</img>";
echo $img;


sleep(5);


if($_GET['cmd']==delete){

echo "delete database entry";

}else{

echo "no not there ok!";

}


?>
Wish i new all about php DAM i will have to learn
((EMAIL CODE THAT WORKS))
http://simpleforum.ath.cx/mail2.inc
((PAYPAL INTEGRATION THAT WORKS))
http://simpleforum.a...aypal1_info.inc

#2 wildteen88

wildteen88
  • Staff Alumni
  • Advanced Member
  • 10,482 posts
  • LocationUK, Bournemouth

Posted 02 July 2006 - 02:23 PM

No this is not how sleep works. Sleep only stops the PHP Intepreter for the number of secounds defined. It does not pause, print something, then pause again and print something else.

#3 redarrow

redarrow
  • Members
  • PipPipPip
  • Advanced Member
  • 7,308 posts
  • Locationlondon

Posted 02 July 2006 - 02:45 PM

so is that inposale then print echo print echo
Wish i new all about php DAM i will have to learn
((EMAIL CODE THAT WORKS))
http://simpleforum.ath.cx/mail2.inc
((PAYPAL INTEGRATION THAT WORKS))
http://simpleforum.a...aypal1_info.inc

#4 trq

trq
  • Staff Alumni
  • Advanced Member
  • 31,041 posts

Posted 02 July 2006 - 04:04 PM

You can try toying around with the output buffer but its highly browser specific and not really worth your while attempting.

This sort of thing would be best handled by javascript / ajax.

#5 redarrow

redarrow
  • Members
  • PipPipPip
  • Advanced Member
  • 7,308 posts
  • Locationlondon

Posted 02 July 2006 - 04:08 PM

can you give a quick example ajax way please chers.
Wish i new all about php DAM i will have to learn
((EMAIL CODE THAT WORKS))
http://simpleforum.ath.cx/mail2.inc
((PAYPAL INTEGRATION THAT WORKS))
http://simpleforum.a...aypal1_info.inc

#6 trq

trq
  • Staff Alumni
  • Advanced Member
  • 31,041 posts

Posted 02 July 2006 - 04:15 PM

Would'nt really need to be ajax unless your retreiving data from a database, pure javascript would do, and there is a whole other forum for such questions.

#7 Drumminxx

Drumminxx
  • Members
  • PipPipPip
  • Advanced Member
  • 92 posts
  • LocationUSA

Posted 02 July 2006 - 04:17 PM

try looking up javascript DHTML

here is a good start

http://www.golivecen...innerhtml.shtml
:: gucci.com ::
:: blockbuster.com ::

--------------------




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users