<?php
    session_start();

    require("../includes/database_connect.php");

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

    if($password == $confirm_password){
        $sql = "insert into users (username,password)  values ('".$username."','".$password."')";

        if ($conn->query($sql)) {
            $_SESSION['success'] = $username." created successfully";
        } else {
            $_SESSION['error'] = "Error updating record: " . $conn->error;
        }
    }else{
        $_SESSION['error'] = "Error : Password not same with confirm password";
    }

   
    
    header('location: ../user_listing.php');

?>