I have HTML form and when click submit form data send to same php page.But after submitting we refresh the page web browser show re-submission dialog.How it's stop form submitting while page refreshing.

My HTML Code: index.php
<form id="cfrm" method="post" action=".">
    <label>If you don't like this colors you can suggest it from here by selecting or copy and paste  </label><input class="color" type="text" name="color1" placeholder="Color 1:ex #AAA" required=""/>
    <input class="color" type="text" name="color2" placeholder="Color 1:ex #CFC" required=""/>
    <input type="submit" id="click" value="Set Colors" name="btnSubmit" />
</form>
PHP code(same page) : index.php
<?php
        if (isset($_POST["btnSubmit"])) {
            $c1 = isset($_POST['color1']) ? $_POST['color1'] : '';
            $c2 = isset($_POST['color2']) ? $_POST['color2'] : '';
            //and do some task here
        }
?>
 
     
     
    