Hey there. I have a 30 second script that is a killer to sit and wait on, so I added a cool loading indicator (attached, use if you want) and set up the following - which will work in all browsers, unlike the swapping out of the src from a previous commentor:
<html>
<head>
<title>Switcheroo</head>
</head>
<body>
<form method="post"><input type="submit" value="Find Results" onClick="document.getElementById('progBar').style.display='block'" /></form>
<div style="display:none" id="progBar"><img src="counter1.gif" /></div>
<?php
/*start off your entire script with a wait on them to push the button.... */
if($_SERVER['REQUEST_METHOD']=='POST') {
/*do all of your script here, then put in the js to make the image disappear at the end of the long script.*/
echo "<script language='javascript'>document.getElementById('progBar').style.display='none'</script>";
}
?>
</body>
</html>
Enjoy! Hope it saved you some time.