How to add new accounts in one php file?

I have different user access levels, and I want to put their PHP code in one .php file. Assume that my submit buttons are named submit-userlevel

newaccount-handler.php

<?php
include('../connect-db.php');

//System Administrator
if($_POST["submit-admin"]){
    $username = $_POST['newuser'];
    $password = $_POST['newpass'];
    $Name = $_POST['name'];
    $sql = "INSERT INTO users (name, position, username, password, access_level) VALUES ('$Name', 'Administrator', '$username', md5 ('$password'), '0')";

    if (!mysql_query($sql)) {
      die("error: " . mysql_error());
    }

    header("Location: home.php");
    mysql_close();
}

//Requestor
if($_POST["submit-requestor"]){
    $username = $_POST['newuser'];
    $password = $_POST['newpass'];
    $Name = $_POST['name'];
    $sql = "INSERT INTO users (name, position, username, password, access_level) VALUES ('$Name', 'User', '$username', md5 ('$password'), '1')";

    if (!mysql_query($sql)) {
      die("error: " . mysql_error());
    }

    header("Location: home.php");
    mysql_close();
}

//BusinessHead
if($_POST["submit-businesshead"]){
    $username = $_POST['newuser'];
    $password = $_POST['newpass'];
    $Name = $_POST['name'];
    $sql = "INSERT INTO users (name, position, username, password, access_level) VALUES ('$Name', 'BusinessHead', '$username', md5 ('$password'), '2')";

    if (!mysql_query($sql)) {
      die("error: " . mysql_error());
    }

    header("Location: home.php");
    mysql_close();
}

?>

Here is my form

<form method="post" action="newaccount-handler.php">
Name: <input type="text" name="name"> <br>
Username: <input type="text" name="newuser"> <br>
Password: <input type="password" name="newpass"> <br>
<input type="submit" name="submit-admin" value="Create">
</form>

Notice: Undefined index is my error. Thank you!

you try like this

if(isset($_POST["submit-admin"])){
    // your code
}