<?php
include 'koneksi.php';

if(isset($_POST['verify'])){

$otp=$_POST['otp'];
$hp=$_POST['hp'];

$result=$conn->query("SELECT * FROM users WHERE no_hp='$hp' AND otp='$otp'");

if($result->num_rows>0){

header("Location: reset_password.php?hp=$hp");

}else{
echo "OTP salah";
}

}
?>

<form method="POST">
<input name="hp" placeholder="Nomor HP">
<input name="otp" placeholder="Masukkan OTP">
<button name="verify">Verifikasi</button>
</form>