<?php /** * Make sure you started your'e sessions! * You need to include su.inc.php to make SimpleUsers Work * After that, create an instance of SimpleUsers and your'e all set! */ session_start(); require_once dirname(__FILE__) . "/simpleusers/su.inc.php"; $SimpleUsers = new SimpleUsers(); // This is a simple way of validating if a user is logged in or not. // If the user is logged in, the value is (bool)true - otherwise (bool)false. if (!$SimpleUsers->logged_in) { header("Location: login.php"); exit; } // If the user is logged in, we can safely proceed. $userId = $_GET["userId"]; //Delete the user (plain and simple) $SimpleUsers->deleteUser($userId); header("Location: users.php");