I'm creating a system and I'm new to php, to generate a token (random numbering) I'm using the following code:
<?php
$tokenSSID = substr(md5(time()),0,6);
?>
then I send this token to another page to check if the user typed it correctly
<?php
include ('conexao.php');
include ('token.php');
<!--tokenID vem da pagina em que o usuario digita o token-->
$tokenID = $_POST["tokenID"];
if($tokenID == $tokenSSID){
echo "<h1><b>Sua senha foi alterada para reis123!</b></h1>";
}
else{
echo "O Token nao foi digitado corretamente!";
}
?>
so far so good but when I click to send and check the token it goes wrong, why on every page that changes, the token also changes and it’s impossible to use, does anyone have any ideas?