Ho pensato di usare un token per rendere unico l'inserimento ma non riesco a farlo funzionare.... Cosa sto sbagliando? Grazie
codice:
<?php
session_start();
include_once('./config.php');
$_SESSION['token'] = uniqid();
?>
<form method="post">
<input type="hidden" name="token" value="<?=$_SESSION['token'];?>" />
<input type="submit" name="submit" value="Inserisci" style="width:100px;"/>
</form>
<?php
if ( isset($_POST['submit'], $_POST['token']) && ($_POST['token'] === $_SESSION['token']) )
{
echo "TEST OK";
}?>