chump2877
07-08-2005, 04:00 AM
Hi,
I have a HTML form:
<form method="post" enctype="multipart/form-data" action="xxxxxxxxx.php">
<input type="hidden" name="MAX_FILE_SIZE" value="2000000">
<br>
<table border="0" cellpadding="0" width="100%">
<tr>
<td align="right" width="45%"><input type="file" name="upload[1]"></td>
<td width="10%"></td>
<td align="left" width="45%"><input type="file" name="upload[2]"></td>
</tr>
<tr>
<td align="right" width="45%"><input type="file" name="upload[3]"></td>
<td width="10%"></td>
<td align="left" width="45%"><input type="file" name="upload[4]"></td>
</tr>
<tr>
<td align="right" width="45%"><input type="file" name="upload[5]"></td>
<td width="10%"></td>
<td align="left" width="45%"><input type="file" name="upload[6]"></td>
</tr>
<tr>
<td align="right" width="45%"><input type="file" name="upload[7]"></td>
<td width="10%"></td>
<td align="left" width="45%"><input type="file" name="upload[8]"></td>
</tr>
<tr>
<td align="right" width="45%"><input type="file" name="upload[9]"></td>
<td width="10%"></td>
<td align="left" width="45%"><input type="file" name="upload[10]"></td>
</tr>
<tr>
<td align="right" width="45%"><input type="file" name="upload[11]"></td>
<td width="10%"></td>
<td align="left" width="45%"><input type="file" name="upload[12]"></td>
</tr>
</table>
<br><br><center><input type="submit" value="Submit"><input type="reset" value="Clear Form"></center>
<br><br>
<input type="hidden" name="mail_to" value="xxxxx@xxxxxxxxxx.com">
<input type="hidden" name="subject" value="File Transfer Confirmation">
<input type="hidden" name="receipt" value="xxxxxx.shtml">
</form>
that I'm using to upload files to a server...When one or more files are selected and then submitted (to be uploaded), a PHP script/file takes over and handles the upload of the files to the server...
What i want to do is, for larger files, add a little animated message that says the files are still transferring....So I whipped out ImageReady and made myself an animated .gif.....
My idea is, when the form is submitted, the user is whisked away to the PHP page that will process the upload...and while that script is transferring the files, I want to force the browser to display my animated .gif with the following code (currently placed at the beginning of the PHP page, before the upload processing code):
if (empty($_FILES['upload']['name'][1]) && empty($_FILES['upload']['name'][2]) && empty($_FILES['upload']['name'][3]) && empty($_FILES['upload']['name'][4]) && empty($_FILES['upload']['name'][5]) && empty($_FILES['upload']['name'][6]) && empty($_FILES['upload']['name'][7]) && empty($_FILES['upload']['name'][8]) && empty($_FILES['upload']['name'][9]) && empty($_FILES['upload']['name'][10]) && empty($_FILES['upload']['name'][11]) && empty($_FILES['upload']['name'][12]))
{
$v = $v;
}
else
{
print '<br<br><center><img src="transfer_animation.gif"></center>';
}
The problem I'm having is that, when the submit button is pressed on the HTML form, the browser never advances to the PHP page and displays my animation....it stays at the HTML form page, the mouse pointer turns to the hour glass, and the status bar of the browser indicates that it's working on something (obviously, it must be uploading, becasue these pages DO work like they're supposed to)....
The funny thing is that the animation code appears BEFORE the upload processing code on the PHP page...So I just assumed that the animation would output to the browser BEFORE the upload processing code kicked in...
How do I force the page to advance to my PHP page and display my animated .gif ??....I'm wondering if this could be acheived with a PHP output control function on the PHP page, to keep the upload processing code from kicking in until after the animation is outputted to the browser, but I'm not sure....
Can someone help?
Thanks.
I have a HTML form:
<form method="post" enctype="multipart/form-data" action="xxxxxxxxx.php">
<input type="hidden" name="MAX_FILE_SIZE" value="2000000">
<br>
<table border="0" cellpadding="0" width="100%">
<tr>
<td align="right" width="45%"><input type="file" name="upload[1]"></td>
<td width="10%"></td>
<td align="left" width="45%"><input type="file" name="upload[2]"></td>
</tr>
<tr>
<td align="right" width="45%"><input type="file" name="upload[3]"></td>
<td width="10%"></td>
<td align="left" width="45%"><input type="file" name="upload[4]"></td>
</tr>
<tr>
<td align="right" width="45%"><input type="file" name="upload[5]"></td>
<td width="10%"></td>
<td align="left" width="45%"><input type="file" name="upload[6]"></td>
</tr>
<tr>
<td align="right" width="45%"><input type="file" name="upload[7]"></td>
<td width="10%"></td>
<td align="left" width="45%"><input type="file" name="upload[8]"></td>
</tr>
<tr>
<td align="right" width="45%"><input type="file" name="upload[9]"></td>
<td width="10%"></td>
<td align="left" width="45%"><input type="file" name="upload[10]"></td>
</tr>
<tr>
<td align="right" width="45%"><input type="file" name="upload[11]"></td>
<td width="10%"></td>
<td align="left" width="45%"><input type="file" name="upload[12]"></td>
</tr>
</table>
<br><br><center><input type="submit" value="Submit"><input type="reset" value="Clear Form"></center>
<br><br>
<input type="hidden" name="mail_to" value="xxxxx@xxxxxxxxxx.com">
<input type="hidden" name="subject" value="File Transfer Confirmation">
<input type="hidden" name="receipt" value="xxxxxx.shtml">
</form>
that I'm using to upload files to a server...When one or more files are selected and then submitted (to be uploaded), a PHP script/file takes over and handles the upload of the files to the server...
What i want to do is, for larger files, add a little animated message that says the files are still transferring....So I whipped out ImageReady and made myself an animated .gif.....
My idea is, when the form is submitted, the user is whisked away to the PHP page that will process the upload...and while that script is transferring the files, I want to force the browser to display my animated .gif with the following code (currently placed at the beginning of the PHP page, before the upload processing code):
if (empty($_FILES['upload']['name'][1]) && empty($_FILES['upload']['name'][2]) && empty($_FILES['upload']['name'][3]) && empty($_FILES['upload']['name'][4]) && empty($_FILES['upload']['name'][5]) && empty($_FILES['upload']['name'][6]) && empty($_FILES['upload']['name'][7]) && empty($_FILES['upload']['name'][8]) && empty($_FILES['upload']['name'][9]) && empty($_FILES['upload']['name'][10]) && empty($_FILES['upload']['name'][11]) && empty($_FILES['upload']['name'][12]))
{
$v = $v;
}
else
{
print '<br<br><center><img src="transfer_animation.gif"></center>';
}
The problem I'm having is that, when the submit button is pressed on the HTML form, the browser never advances to the PHP page and displays my animation....it stays at the HTML form page, the mouse pointer turns to the hour glass, and the status bar of the browser indicates that it's working on something (obviously, it must be uploading, becasue these pages DO work like they're supposed to)....
The funny thing is that the animation code appears BEFORE the upload processing code on the PHP page...So I just assumed that the animation would output to the browser BEFORE the upload processing code kicked in...
How do I force the page to advance to my PHP page and display my animated .gif ??....I'm wondering if this could be acheived with a PHP output control function on the PHP page, to keep the upload processing code from kicking in until after the animation is outputted to the browser, but I'm not sure....
Can someone help?
Thanks.