<?php 
include 'conn.php';
$data = [];
$userID = $_POST['user'];
$password = $_POST['password'];
$role = $_POST['role']; 
$hashed = hash('sha512', $password);
$desc = "INSERT INTO `users`(`userID`, `password`, `plain`, `role`, `status`)
 VALUES ('$userID','$hashed','$password','$role','1')";
$descRes = $mysqli->query($desc);
if($descRes){
    $response['status'] = true;
    $response['response'] = "User Created Successfully";  
    die(json_encode($response));
}else{
    $response['status'] = false;
    $response['response'] = $mysqli -> error;  
    die(json_encode($response));
}
 
 


?>