I have developed a login page where OTP is generated for every login of the user .The following is a button action , I have created a "generate" button once clicked it would starts a session timer and after 60 sec it should delete the varchar present in the database.
PHP Code for button :
if(isset($_POST['generate']))
{
session_start();
$_SESSION['login_time'] > 60 ;
{
$sql = "DELETE password WHERE username = ajaisandy " ;
}
Here the "password" represent the column name , once the user enters the "generate button" the session starts and gives a time period of 60 sec . The user is suppose to receive the OTP via sms and should sign in within this time if not the password stored in the DB is deleted and once again he has to perform this sequence to login.