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.41.251


Current Path : /var/www/html/demo/studentportal/src/
Upload File :
Current File : /var/www/html/demo/studentportal/src/submitquery.php

<?php
include ("database.php");

$femail = trim($_POST['femail']);
$fsubject = trim($_POST['fsubject']);
$fmessage = trim($_POST['fmessage']);

if($_SESSION['MOBILE'] != '')
{
	$funivcode = $_SESSION['UNIVCODE'];
	$query = "insert into logisys3_grv.grvhead(fgrvdate, fregno, fgrvfrom,fgrvemail,fgrvmobile,fgrvsub,
		fgrvmsg,fgrvuser,fgrvmode,funivcode,fstudemail,fgrvgroup)
		values (now(),'{$_SESSION['REGNO']}','{$_SESSION['SNAME']}','{$_SESSION['EMAIL']}','{$_SESSION['MOBILE']}',
		'{$fsubject}','{$fmessage}','Student','stud. port.','{$funivcode}','{$femail}', '99')";
	// $result = mysqli_query($conn,$query);

	if($conn->query($query) === TRUE)
	{
		$last_id = $conn->insert_id;
		$res['msg'] = $last_id;
		$res['status'] = "success";
		$res['error_code'] = 0;
		echo json_encode($res);		
	}
	else
	{
		$res['msg'] = 'Not able to submit the query. please try after some time.';
		$res['status'] = "failure";
		$res['error_code'] = -2;
		echo json_encode($res);		
	}

}
else
{
	$res['msg'] = 'Please login to submit the query.';
	$res['status'] = "failure";
	$res['error_code'] = -2;
	echo json_encode($res);
}