It isn't handled with php, it's handled with javascript. I'll write you a quick little function, change the names if need be.
HTML form
<form name="my_form" action="blah.php" method="post">
<input type="text" name="your_name" size="30"><br />
<input type="button" name="button_dood" onMouseUp="Prevent();" value="Submit!">
</form>
Javascript
<script language="javascript" type="text/javascript">
function Prevent() {
document.my_form.button_dood.disabled = true;
document.my_form.button_dood.value = 'Processing Form...';
document.my_form.submit();
} // End function
</script>
If you need to change the name of your form you would do this for all the lines in the javascript function:
Replace: document.my_form.button_dood with
document.your_form_name_here.your_button_n
ame_here
Also, in document.my_form.submit(); you would change my_form with the name of your form. I think it's pretty self explanitory if you look at the entire code. Just make sure you keep the onMouseUp event for your button.