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 : 3.137.186.26


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

<?php   
include ('/var/www/html/sms/sendsmsapiv1.php');
include("/var/www/html/univadmin/src/sendGridMail.php");

$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());
}
    $FMOBILE = $_POST["fmob"];
    $date = date('Y-m-d H:i:s');

    $query = "select * from memhead where FMOBILE='{$FMOBILE}'";
    
    $result1 = mysqli_query($conn,$query);
    $row = mysqli_fetch_assoc($result1);
    $count = mysqli_num_rows($result1);
  
    // if($fccode === "+91"){
        if($count == 1){
            date_default_timezone_set('Asia/Kolkata');
            $time =  date("h:i A");
            $otp = rand(100000, 90000);
            $smsotp = "From BKMH: Dear User, OTP for Registration is $otp. sent at {$time} - Uniclare";
            $sms = new SMS('098', 'OTP');
            $sms->sendIndvidualSms($FMOBILE, $smsotp, '900', 'PGET');
            
            $smsresp = 'Sent';
            $row0["sms"] = $smsresp;

            $query = "update memhead set FMOBOTP = '{$otp}' where FMOBILE='{$FMOBILE}'";
            // var_dump($query);die();
            $result = mysqli_query($conn, $query);

            if($result){
                $row1["status"] = 'success';
                $row1["msg"] = 'OTP Sent To Your Mobile No. Please Verify';
                echo json_encode($row1);
            }else{  
                $row1["status"] = 'invalid';
                $row1["msg"] = 'Failed';
                echo json_encode($row1);
            }
            
        }else{
            $row2['status'] = 'invalid';
            $row2['msg'] = 'Failed';
            echo json_encode($row2);
        }
    

mysqli_close($conn);
?>