I'm including a PHP script with in a main PHP page.
Help me "how to show a Preloader/loading animation or gif or swf or simply percentage of loading while the included PHP script processes & loads?" Here is the code snippet where I want to show the same (See the last line of code):
<body onLoad="document.forms.form1.from.focus()">
<font face="Calibri">
<table cellpadding="10">
<form action="<?=$_SERVER['PHP_SELF']?>" method="post" name="form1">
<tr>
<td width='25%'>
<fieldset>
<legend>Enter From & To Date</legend>
<table border='0'>
<tr>
<td>From </td>
<td><input type="text" name="from" /></td>
</tr>
</fieldset>
<input type="submit" name="submit" value="Submit" />
</td>
</tr>
</form>
</table>
<?
//Form submitted
if(isset($_POST['submit']))
{
//No errors, process
if(!@is_array($error))
{
HERE IS WHERE I WANT THE LOADING TO TAKE PLACE
//HERE I INCLUDE THE SCRIPT
Also, if i can delay the display of the PHP script until it completes processing.
Put a
<div>
containing your loading screen right after the<body>
(or at least before the time-consuming loading happens). At the very end (or after the long part which should be covered by the loading screen) add some JavaScript to hide/remove the div containing the loading screen.This is my modified version of a script I got off the internet. Cant remember where I got it from sorry.