name : regis_member.php
<?php 
include('../config/config.php');

$fullname   = $_POST['fullname'];
$username   = $_POST['username'];
$password   = $_POST['password'];


$check_sql = "SELECT * FROM admin WHERE a_username = '".$username."'";
$res_check = $conn->query($check_sql);
$num_rows = $res_check->num_rows;

if($num_rows > 0){
    echo 2;
    exit();
}else{

    $sql = "INSERT INTO admin (a_fullname,a_username,a_password,a_create_at,a_status) VALUE ('".$fullname."','".$username ."','".$password."',now(),'0')";
    $res = $conn->query($sql);
    if ($res === TRUE) {
        echo 1;
    }else{
        echo 0;
        exit();
    }
}
$conn->close();

?>

© 2024 UnknownSec