Possible Duplicate:
How to show ajax loading gif animation while the page is loading?
I'm saving an image to my server via PHP. The process can take a while as the image is of high-resolution. What I'd like to do is to display a loading/saving icon (or animated gif) while the user waits. I've taken a look at various JQuery/javascript/CSS suggestions but I can't seem to get them to work. Here is my current code without the icon:
<?php
if ( isset ( $GLOBALS["HTTP_RAW_POST_DATA"] )) {
// get bytearray
$im = $GLOBALS["HTTP_RAW_POST_DATA"];
$fp = fopen('img/myImage.png', 'wb');
fwrite($fp, $im);
fclose($fp);
header('Location: http://www.mysite.com');
} else echo 'An error occured.';
?>
Any suggestions would be greatly appreciated.
Thanks.