You could try something like this:
<html>
<head>
<title>Untitled</title>
</head>
<body>
<?
function Main()
{
?>
User Management:<br>
<form action="ThisPage.php">
<input type="submit" name="Submit" value="Add User">
<input type="submit" name="Submit" value="Delete User">
</form>
<?
}
function Confirm()
{
?>
<form action="ThisPage.php">
Are you sure you want to delete this user?
<input type="submit" name="Submit" value="Yes">
<input type="submit" name="Submit" value="No">
</form>
<?
}
function DeleteUser()
{
//Delete the user info from the database
echo "User was delete successfully.";
echo "<a href='ThisPage.php'>Continue</a>";
}
function AddUser()
{
//Stuff for adding a user
}
if ($_POST["Submit"] == "Delete User")
{
Confirm();
}
elseif ($_POST["Submit"] == "Yes")
{
DeleteUser();
}
elseif ($_POST["Submit"] == "Add User")
{
AddUser();
}
else
{
Main();
}
?>
</body>
</html>
So, the way this works is to use the value of the Submit button to control page flow. When you first call the page, $_POST["Submit"] = nothing, so the function Main() gets called. If you click on "Delete User" button, then the Confirm() function get's called, and so on... Also, your going to have to keep track of the UserID, probably with hidden form fields, and pass them into the fucntions, such as:
function Confirm($UserID)
// ...and...
if ($_POST["Submit"] == "Delete User")
{
Confirm($_POST["UserID"]);
}