php function like javas setTimeout??

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



I have a site that does the following:

You fill out a form with client info, click process, it moves to another page that calls a few php functions i wrote (sending client welcome email, adding client details to database and a few other things). What I want the page to do is delay some of the content that gets displayed on the php. the only way i've been able to do this is with a javascript using setTimeout. I know this isn't a javascript list but here is my javascript so you have a better idea what I'm trying to do:

--- start code ---

<SCRIPT Language="Javascript" type="text/javascript">
<!--

function timeout() {
setTimeout("replace()",2000);
setTimeout("replace2()",3000);
setTimeout("replace3()",5000);
setTimeout("replace4()",5500);
}

function replace() {
timed_text = document.getElementById("repl").firstChild.nodeValue;
document.getElementById("repl").firstChild.nodeValue=timed_text + " Done.";
}
function replace2() {
timed_text2 = document.getElementById("repl2").firstChild.nodeValue;
document.getElementById("repl2").firstChild.nodeValue=timed_text2 + " Done.";
}
function replace3() {
timed_text3 = document.getElementById("repl3").firstChild.nodeValue;
document.getElementById("repl3").firstChild.nodeValue=timed_text3 + " Done.";
}
function replace4() {
timed_text4 = document.getElementById("repl4").firstChild.nodeValue;
document.getElementById("repl4").firstChild.nodeValue="Complete.";
}
//-->
</SCRIPT>

</HEAD>

<BODY onLOAD="timeout()">

<DIV id="repl">Adding client to database... </DIV>
<DIV id="repl2">Configuring clients account... </DIV>
<DIV id="repl3">Sending client welcome letter... </DIV>
<DIV id="repl4">&nbsp;</DIV>

--- end code ---

I know this method is horid and the code is.... ya. But I'm just trying to see if i can do it before i work really hard on it, then I'll fix the code, so please don't make comments regarding the crappy code.

Anyhow, as you can see, I want the page to display "Adding client to database..." then wait a few seconds while the php script runs the function 'fnc_addClient', after it's done io want the page to display "Done" so it would show:
Adding client to database....  Done

Any ideas how I can get this done with php? I've attempted the sleep () with flush() but none of that is working.




Brian deBottari
Web Developer and System Administrator
sin7 Studios / sin7networks.us

brian@xxxxxxxxxxxxxxx



[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux