Location: PHPKode > projects > Simple SMS Site Software > simple-sms-site-software/do_delete_user.php
<?php
/******************************************************************************
************** Simple SMS Site Software *********************************
************** SSSSv1.0*****************************************************
************** by (aq) limited http://aql.com *******************************
************** All Rights Reserved ******************************************
************** Please read COPYRIGHT file prior to modification********
********************************************************************************/
	
session_start();

include("inc/header.inc.php");

$deluser = $_SESSION['delUser'];

if ($access == 'admin') {

	include("inc/dbinfo.inc.php");

	$query = "DELETE FROM `users` WHERE `username` = '$deluser' LIMIT 1";
	$result = mysql_query($query);
	if (!$result) {
	   	echo 'Could not run query: ' . mysql_error();
		exit;
	}
	else {
	?>
		<p align="center">User Removed</p>
	<?
	}
	
	$query = "DELETE FROM `address_book` WHERE `username` = '$deluser'";
	$result = mysql_query($query);
	if (!$result) {
	   	echo 'Could not run query: ' . mysql_error();
		exit;
	}
	else {
	?>
		<p align="center">Address Book Contact(s) Removed</p>
	<?
	}
}
else {
	include("inc/restricted.inc.php");
}
include("inc/footer.inc.php");
?>
Return current item: Simple SMS Site Software