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 : 18.188.245.152


Current Path : /var/www/html/studentportal_wait/
Upload File :
Current File : /var/www/html/studentportal_wait/validateInfo.php

<?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']);

if($univcode == '001' && strlen($regno) == 7 )
	$regno = '9'.$regno;

$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 (funivcode = '{$univcode}'  and fregno = '{$regno}')) and factive = 'T'  limit 1 ";

 //var_dump($query);
$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);
}


?>