robbster Posted February 13, 2008 Share Posted February 13, 2008 I'm looking for some help and hopefully some can help...here's my dilemma. I have a php script that I say when it's loaded to the browser, it prints hello world, sleeps for say 3 seconds, and replaces that 'hello world' string with 'bye'... ...kind of like the blinking 'processing' and when the php finishes whatever it is processing, it replaces the blinking 'processing' with some other info. Can anyone shine some light plz? Thanks. Quote Link to comment Share on other sites More sharing options...
phpQuestioner Posted February 13, 2008 Share Posted February 13, 2008 <script language=""> function intialize() { document.getElementById('myDIV').innerHTML='Goodbye' // Echo PHP Where The Static "Goodbye" Currently Is } window.onload=function() { setTimeout("intialize()", 3000); } </script> <span id="myDIV">Hello<!-- Echo Intial PHP Value Here Where Static "Hello" Currently Is --></span> World Quote Link to comment Share on other sites More sharing options...
robbster Posted February 13, 2008 Author Share Posted February 13, 2008 thanx phpQuestioner...truly appreciate it. I guess I should really describe what I'm doing. I have a php script that successfully uploads a file. It then processes it that takes about 3-10 seconds long. After it finishes the processing, it displays links to what it processed. My goal is to put some kind of a <blink>Processing</blink> before I start the processing and then replace it with the links. Any ideas? Thanks. Quote Link to comment Share on other sites More sharing options...
phpQuestioner Posted February 13, 2008 Share Posted February 13, 2008 Well what your wanting to do; using PHP Sleep() function; probably will not display any content in you page, until the sleep time is up. Why are you wanting to use the sleep function? You could do this with ajax; like when someone starts uploading a file; display text or an image in a html element (like a: span, div, or whatever) and then when your file loads; have you ajax to update the response text of that you would echo in your php page (once the file is uploaded); back to your html element. If you want it to blink; the easiest way is to use a animated gif - that is what I do. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.