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.226.187.60
<?php
include("config.php");
$conn = new mysqli($servername,$username,$password,$database);
var_dump($conn);die();
if(!$conn)
{
die("Connection failed: " . mysqli_connect_error());
}
error_reporting(E_ALL);
ini_set('display_errors', 'on');
$FMEMNAME = $_POST["FMEMNAME"];
$FBATCH = $_POST["FBATCH"];
$FMOBILE = $_POST["FMOBILE"];
$FDEGREE = $_POST["FDEGREE"];
$FCNTCODE = $_POST["FCNTCODE"];
$FEMAIL = $_POST["FEMAIL"];
$FALTMOBILE = $_POST["FALTMOBILE"];
$FALTCNTCODE = $_POST["FALTCNTCODE"];
$FYOA = $_POST["FYOA"];
$FYOM = $_POST["FYOM"];
$comadres1 = $_POST["comadres1"];
$comadres2 = $_POST["comadres2"];
$pincodecom = $_POST["pincodecom"];
$statec = $_POST["statec"];
$ccountry = $_POST["ccountry"];
$peradres1 = $_POST["peradres1"];
$peradres2 = $_POST["peradres2"];
$pincodeper = $_POST["pincodeper"];
$statep = $_POST["statep"];
$pcountry = $_POST["pcountry"];
$date = date('Y-m-d H:i:s');
$query = "INSERT INTO memhead (FMEMNAME, FBATCH, FMOBILE, FDEGREE, FCNTCODE, FEMAIL,
FALTMOBILE,FYOA,FYOM,FADDC1,FADDC2,FPINCODEC,FSTATEC,FCONTC,FADDP1,FADDP2,FSTATEP,FCONTP,FPINCODEP,
FLOGDATE)
VALUES ('{$FMEMNAME}','{$FBATCH}','{$FMOBILE}','{$FDEGREE}','{$FCNTCODE}','{$FEMAIL}',
'{$FALTMOBILE}','{$FYOA}','{$FYOM}','{$comadres1}','{$comadres2}','{$pincodecom}','{$statec}',
'{$ccountry}','{$peradres1}','{$peradres2}','{$statep}','{$pcountry}','{$pincodeper}',
'{$pincodeper}','{$date}')";
$result = mysqli_query($conn,$query);
if($result){
$query = "select * from memhead where FMOBILE='{$FMOBILE}'";
$result = mysqli_query($conn,$query);
$row = mysqli_fetch_assoc($result);
$count = mysqli_num_rows($result);
}
if($count == 1){
date_default_timezone_set('Asia/Kolkata');
$time = date("h:i A");
$otp = rand(1000, 9000);
$smsotp = "From $database: Dear Sir, OTP for Registration is $otp. sent at {$time} - B.K. Mariappa's Charities";
$sms = new SMS('026', 'OTP');
$sms->sendIndvidualSms($FMOBILE, $smsotp, '900', 'PGET');
$smsresp = 'Sent';
$row["sms"] = $smsresp;
$query = "update memhead set FMOBOTP = '{$otp}' where FMOBILE='{$FMOBILE}'";
$result = mysqli_query($conn, $query);
if($result){
$row["fstatus"] = 'success';
$row["msg"] = 'Successfully registered';
echo json_encode($row);
}else{
$row["fstatus"] = 'invalid';
$row["msg"] = 'Registered Failed';
echo json_encode($row);
}
echo json_encode($row);
}else{
$row['status'] = 'invalid';
echo json_encode($row);
}
mysqli_close($conn);
?>
|