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.64.210
<?php
include ("database.php");
$mobile = trim($_POST['mobile']);
$regno = trim($_POST['regno']);
$emailid = trim($_POST['email']);//univ
$univcode = trim($_POST['univ']);
$dob = trim($_POST['dob']);//password
$passwd = trim($_POST['password']);
$concatRegno = $univcode.''.$regno;
//and fmobileotp = '3313'
$query = "SELECT ifnull(sum(if(fmobileno = '{$mobile}',1,0)),0) as fmobexist,
ifnull(sum(if(femail = '{$emailid}',1,0)),0) as femailexist,
ifnull(sum(if(concat(funivcode,fregno) = '{$concatRegno}',1,0)),0) as fregexist
from masuser where (fmobileno = '{$mobile}' or femail = '{$emailid}'
or concat(funivcode,fregno) = '{$concatRegno}') and factive = 'T' limit 1 ";
$result = mysqli_query($conn,$query);
$count = mysqli_num_rows($result);
$row = $result->fetch_assoc();
if($row['fmobexist']=='0' && $row['femailexist']=='0' && $row['fregexist']=='0')
{
$query = "SELECT fname, ffather, fmother from pushstud
where funivcode = '{$univcode}' and fregno = '{$regno}'";
$result = mysqli_query($conn,$query);
$count = mysqli_num_rows($result);
if($count > 0)
{
/*$query = "insert into masuser(fmobileno, femail, fregno,
fdob, funivcode, fpasswd)
values('$mobile', '{$emailid}', '{$regno}','{$dob}',
'{$univcode}', '{$passwd}')";
//echo mysqli_query($conn,$query);
if (mysqli_query($conn,$query))
{*/
$row = mysqli_fetch_assoc($result);
$arr["status"] = 'success';
$arr["result"] = $row;
echo json_encode($arr);
/*}
else
{
$arr["status"] = 'error';
echo json_encode($arr);
}*/
}
else
{
$arr["status"] = 'invalidreg';
echo json_encode($arr);
}
}
else
{
$arr["status"] = 'invalid';
$arr["result"] = $row;
echo json_encode($arr);
}
?>
|