JezK
Edit File: resetPassword.php
<?php include_once("app/adminObj.php"); include_once("app/checkSession.php"); $etoken=''; if(isset($_REQUEST['etoken'])) { $etoken=$_REQUEST['etoken']; } $res=$customerObj->checkEtoken($etoken); // echo $res; // exit; if($res==1){ ?> <!DOCTYPE html> <html lang="en" class="h-100"> <head> <title>Uflexit</title> <meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1"> <!-- <link rel="stylesheet" href="css/font-awesome.min.css"> --> <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css"> <link rel="stylesheet" href="css/bootstrap.min.css"> <link rel="stylesheet" href="css/login.css"> <script src="js/jquery.min.js"></script> <script src="js/popper.min.js"></script> <script src="js/bootstrap.min.js"></script> </head> <body class="login h-100"> <div class="container-fluid h-100"> <div class="row h-100"> <div class="col-md-6 p-0 position-relative" style="height:100%"> <div class="img-div"> <img src="images/Customer_croppings/loginimage.png" class="login-bg m-0"></div> <img src="images/Customer_croppings/loginlogo.png" class="logo-cls"> <!-- <p class="login-bg m-0"></p> --> </div> <!--form --> <div class="col-md-6 h-100 bg-white pt-5 "> <div class="justify-content-center d-flex flex-column h-100"> <div class="row d-flex justify-content-center"><div class=""> <p class="text-center text-clr-blue">Change password</p> </div></div> <div> <?php echo $customerObj->flashMessage();?> <form class="form" action="app/changePassword.php" method="post"> <div class="log-body"> <div class="row h-100 "> <div class="col-md-12 mb-4 pr-0"> <label for="inputEmail" class="inpt-label">New Password</label> <div class="input-container"> <input type="text" id="password" name="password" value="" class="form-control frm-input" placeholder="Enter new password"> <i class="fa fa-eye icon icon-display" id="togglePassword"></i> </div> <div class="error password_error"></div> </div> <div class="col-md-12 mb-1 pr-0"> <label for="inputEmail" class="inpt-label">Confirm Password</label> <div class="input-container"> <input type="text" id="cnfrmPassword" name="cnfrmPassword" value="" class="form-control frm-input" placeholder="Enter confirm password"> <i class="fa fa-eye icon icon-display" id="togglePassword2"></i> </div> <div class="error cnfrmPassword_error"></div> </div> </div> <input type="hidden" name="token" value="<?php echo $etoken;?>"> <div class="col-md-12 mb-4 py-4 ml-3"> <input type="submit" name="forgetPasswordRequest" value="Reset password" class=" btn btn-primary w-100 btn-login py-2 " onclick="return passwordGeneration();"/> </div> </div> </div> </form> </div> </div> </div> </div> </div> </body> </html> <?php } else{ if($_REQUEST['type']==1){ echo "<script>alert('Congratulations your password has been set...! ')</script>"; $customerObj->redirect('./login.php'); } else { echo "<script>alert('Congratulations your password has been set...! ')</script>"; $customerObj->redirect('./owner_login.php'); } }?> <?php include_once("scriptsLinks.php");?> <script> const togglePassword = document.querySelector('#togglePassword'); const password = document.querySelector('#password'); const togglePassword2 = document.querySelector('#togglePassword2'); const password2= document.querySelector('#cnfrmPassword'); togglePassword.addEventListener('click', function (e) { // toggle the type attribute const type = password.getAttribute('type') === 'password' ? 'text' : 'password'; password.setAttribute('type', type); // toggle the eye slash icon this.classList.toggle('fa-eye-slash'); }); togglePassword2.addEventListener('click', function (e) { // toggle the type attribute const type = password2.getAttribute('type') === 'password' ? 'text' : 'password'; password2.setAttribute('type', type); // toggle the eye slash icon this.classList.toggle('fa-eye-slash'); }); </script>