I check like so:
PHP:
if( $_POST['submit'] && $_POST['submit'] != "" ) {
// then the form was posteed
}
else
// it was not
<html><body>
<br><center>
<table style="border: 2px red;" cellpadding="5"><tr><td>
<font face="tahoma" size="1">
<?php
if ($submit) {
echo "You just submited the form!";
} else {
?>
<form method="post" action="<?php echo $PHP_SELF ?>">
First Field: <input style="font-family: verdana, arial, "ms sans serif", sans-serif; font-size: 8pt; color: #000000; background-color: #ffffff; border: 1 solid #000000;" type="text" name="first"><br>
Second Field: <input style="font-family: verdana, arial, "ms sans serif", sans-serif; font-size: 8pt; color: #000000; background-color: #ffffff; border: 1 solid #000000;" type="text" name="second"><br><br>
<center><input style="font-family: verdana, arial, "ms sans serif", sans-serif; font-size: 8pt; color: #000000; background-color: #ffffff; border: 1 solid #000000;" type="Submit" name="submit" value="Do it!"><center>
</form>
<?php } ?>
</td></tr></table></center>
</body></html>
if( $_POST['submit'] && $_POST['submit'] != "" ) {
// then the form was posteed
}
else
// it was not