I have the following code sample upload3.php:
PHP Form Upload
Try looking at the REQUEST_METHOD and see if it's POST. It's a little bit nicer.
REQUEST_METHOD