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.118.166.45
<?php
$dbhost = "logisys.cluster-cv9maxyrxjgg.ap-south-1.rds.amazonaws.com";
$dbuser = "admin";
$dbpass = "T0g3th3r@all";
$db = "logisys3_nub";
$conn = new mysqli($dbhost, $dbuser, $dbpass,$db) or die("Connect failed: %s\n". $conn -> error);
// var_dump($conn);
$username = $_POST['username'];
$password = $_POST['password'];
if(strpos($password,"&") > 0){
$arr['error_code'] = -1;
$arr['msg'] = 'Failed';
echo json_encode($arr);
return;
}else if(strpos($password,"r") > 0){
$arr['error_code'] = -1;
$arr['msg'] = 'Failed';
echo json_encode($arr);
return;
}
else if(strpos($password,"=") > 0){
$arr['error_code'] = -1;
$arr['msg'] = 'Failed';
echo json_encode($arr);
return;
}
else if(strpos($password,"R") > 0){
$arr['error_code'] = -1;
$arr['msg'] = 'Failed';
echo json_encode($arr);
return;
}
$query="SELECT * FROM notif_login WHERE FUSERNAME = '{$username}' AND FPASSWORD = '{$password}'";
$run=mysqli_query($conn,$query);
$count = mysqli_num_rows($run);
// var_dump($count);
// die();
if($count == 1){
session_start();
$_SESSION['username'] = $username;
// var_dump($username);
$arr['error_code'] = 0;
$arr['msg'] = 'Success';
echo json_encode($arr);
return;
}else{
$arr['error_code'] = -1;
$arr['msg'] = 'Failed';
echo json_encode($arr);
return;
}
?>
|