Being an ASP developer, I always had the mentality that session variables would not be set when the user disable the feature in her browser. However, with PHP, session variables are stored in two places, the client's and the server's. I've tested my application against the browser being at high security level, which infers that all persistence data and cookies are disabled. My application still worked. So in summary, I had to resolve to using session varialbes, and my solution is simple yet effective than those that are proposed in this thread. Well, here it is:
<?php
session_start();
session_register("submittedId");
if(!isset($submit))
{
$submitId = 1;
$submittedId = 0;
}
if(isset($submit))
{
if($submitId != $submittedId)
{
//codes
$submittedId = $submitId;
$submitId = ($submitId == 0) ? 1 : 0;
}
else
{
$submitId = ($submitId == 0) ? 1 : 0;
}
}
?>
<input type="hidden" name="submitId" value="<?=$submitId?>">
For those of you who do not understand this little coding, let me know so I can comment them.
For those who understand this, let me know if you could come up with a better solution.