The problem is actually with f5, if I press f5, then an empty form flies to the base, how to fix it?
2 answers
for example, if the summit button is pressed with the name "go"
That handler will start with
if (isset($_REQUEST['go'])){ //заносим в базу }
- Plus use the captcha and as an example, and after entering the base, do exit (header ("Location: / path")) - Maksym Prus
- To go nuts , brilliant and simple) thanks - dikardRus
|
<?php if(isset($_POST['sbt'])){ // fill db ?> <script type="text/javascript"> setTimeout(function(){location.replace(location.href);}, 3000); </script> <p>Форма заполнена, вы будете переадресованы через 3 секунды. Если не получилось - жмите <a href="<?=$_SERVER['PHP_SELF']?>">сюда</a>.</p> <?php } else { ?> <form action="<?=$_SERVER['PHP_SELF']?>" method="post"> <input type="submit" name="sbt" /> </form> <?php } ?>
|