Location: PHPKode > projects > Simple SMS Site Software > simple-sms-site-software/do_delete_contact.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");

$user = $_SESSION['user'];
$pass = $_SESSION['pass'];
$del_user = $_GET['u'];
$del_contact = $_GET['n'];
$del_pass = $_GET['p'];

if ($del_user == $user or $access == "admin") {
	
	if ($del_pass == $pass or $access == "admin") {

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

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