php prevent form resubmission using sessions
<p>So I am trying to prevent form resubmission using sessions 
and this is my code :</p>

<pre><code>&lt;?php
session_start();
if(isset($_GET['unid']))
{
    if ($_GET['unid']==$_SESSION["uid"])
    {
        echo "Form is Submited do something";
    }
    else
    {
        echo "no you can't do that";
    }
}
$unid = md5(uniqid());
$_SESSION["uid"] = $unid;
?&gt;
&lt;form method="GET"&gt;
    &lt;input name="name" value="test"&gt;
    &lt;input name="unid" value="&lt;?php echo $unid;?&gt;"&gt;
&lt;input type="submit"&gt;
</code></pre>

<p>and it works ...but if the user opens another tab then it will break so how can I fix it ?</p>