Temporary msg while using usleep function
<p>I want to delay the execution of script and i use the usleep function to make it actually calculating something before output. I want a message to be displayed while it's in delay mode. Example : Once user click submit button a message shows "Please wait we are now processing your request..." and disappear when the usleep times up and the results shows. My code :</p>

<pre><code>&lt;div&gt; 
&lt;form id="form1" name="form1" method="post" action=""&gt;
&lt;label&gt; 
&lt;select name="fortune" id="fortune"&gt;&lt;?php callcombobox('fortune',$fortune); ?&gt;&lt;/select&gt;
&lt;/label&gt;
&lt;input name="submitbtn" type="submit" id="submitbtn" class="submitbutton" value="Submit" style="width:180px; height:30px;" /&gt;
&lt;/p&gt;
&lt;/form&gt;
&lt;/div&gt;
&lt;div&gt;
&lt;?php
echo 'Please wait while we are processing your request..'; 
flush();
usleep(5000000);
?&gt;
&lt;p class="textcolor"&gt;Your fortune is  ：&lt;/p&gt;
&lt;p class="textcolor"&gt;&lt;?=nl2br($returnanswer)?&gt;&lt;/p&gt;//result of fortune
&lt;/div&gt;
</code></pre>

<p>I'm newbie to php and tried the code above it doesn't show the echo msg it only shows together with the result retrieved from database when times up. Anyone can help? Thanks.</p>
