<?php
session_start();
if($_POST){
if($_POST['otp']==$_SESSION['otp']){
$user=$_SESSION['mobile'];
$pass=$_SESSION['otp'];
echo "<form method='post' action='{$_SESSION['link_login']}'>
<input type='hidden' name='username' value='$user'>
<input type='hidden' name='password' value='$pass'>
</form><script>document.forms[0].submit()</script>";
exit;
}
}
?>
<form method="post">
<input type="text" name="otp" placeholder="Enter OTP">
<button>Verify</button>
</form>