GIF89a php
Current File : /home/hencockfreshchic/public_html/admin.cpanel/saveUser.php
<?php
ob_start();
ini_set('error_reporting', E_STRICT);
include("connect.php");

$user_name=$_POST['Uname'];
$emailid=$_POST['emailid'];
$mobb=$_POST['mobb'];
$pwd=$_POST['pwd'];
$select=$_POST['select'];


// check if the user is exist or not
$sql="SELECT * FROM `admin_user` WHERE `username`='".$emailid."' || `mobb`='".$mobb."'";
$rs=mysqli_query($conn,$sql);
$check=mysqli_num_rows($rs);
if($check>0)
{
	echo '<script>alert("User is already exist"); window.location.href="webAdmin.php";</script>';
}
else
{
	$sql2="INSERT INTO `admin_user`(`user_name`, `username`,`mobb`, `password`, `types`, `datee`, `approve`) VALUES ('".$user_name."','".$emailid."','".$mobb."','".$pwd."','".$select."','".date('Y-m-d')."','1')";

	$rs2=mysqli_query($conn,$sql2);
	if($rs2>0)
	{
		echo '<script>alert("New Admin has been created"); window.location.href="webAdmin.php";</script>';
	}
	else
	{
		echo '<script>alert("Unable to create new user | contact to developers"); window.location.href="webAdmin.php";</script>';
	}
	
}
?>