/**
* enc
*/
function encrypt($token_time) {
return md5(‘!@##$@$$#%43′ . $token_time);
}
$token_time = time();
$token = encrypt($token_time);
$expire_time = 10;
if ($_POST) {
$_token_time = $_POST['token_time'];
$_token = $_POST['token'];
if ((time() – $_token_time) > $expire_time) {
echo “expired token”;
echo “
”;
}
echo $_token;
echo “
”;
$_token_real = encrypt($_token_time);
echo $_token_real;
//compare $_token and $_token_real
}
?>
test for csrf
” />
” />