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.224.73.107
<?php
session_start();
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');
$compname = $_POST["fcompname"];
$faddress = $_POST["faddress"];
$fname = $_POST["fname"];
$fmobile = $_POST["fmobile"];
$femail = $_POST["femail"];
$pwd = $_POST["pwd"];
$otp = $_POST["otp"];
$query = "select * from corpuser where fmob = '{$fmobile}' and fotp = '{$otp}'";
$result = mysqli_query($conn, $query);
$row = mysqli_fetch_assoc($result);
$count = mysqli_num_rows($result);
// var_dump($count);
// die();
if($count > 0){
$query = "update corpuser set fcompname = '{$compname}', faddress = '{$faddress}', fpername = '{$fname}', femail = '{$femail}', fcotptime = now(), fpassword = '{$pwd}', fcfotp = '{$otp}' where fmob = '{$fmobile}' and fotp = '{$otp}'";
$result = mysqli_query($conn,$query);
if($result == 1)
{
$arr["status"] = 'success';
}else
{
$arr["status"] = 'error';
}
}else
{
$arr["status"] = 'invalid';
}
echo json_encode($arr);
?>
|