View Full Version : sleep() question

02-10-2006, 02:42 AM
I have this code:





echo 'HELLO WORLD!';



<script language="JavaScript">

window.opener.location.href = window.opener.location.href;

if (window.opener.progressWindow)




I want to know why I don;t see the phrase "HELLO WORLD!" on the screen for 10 seconds before the javascript closes the window....

Right now, I see a blank screen, then the window closes....How come?


Nevermind, this is resolved. I found the answer here: http://www.codingforums.com/showthread.php?t=77880&highlight=sleep

02-10-2006, 01:43 PM
Because you sleep for 20 seconds on the server side, and then the script finishes, php outputs all the data in the output buffer and then the page is loaded but closed instantly by the javascript.

PHP is not intended to manipulate the client side.

[edit:] Didn't see you'd resolved it.. oh well, just another explanation for future searches.

sir pannels
02-10-2006, 03:05 PM
was just gonna point you in the direction of my thread :)