Location: PHPKode > projects > H-tracker > takedelfriend.php
<?
//
//  H-Tracker v0.2
//    http://h-tracker.org
//    Based on TorrentTrader (http://www.torrenttrader.org)
//
//
require_once("backend/functions.php");
dbconn();
loggedinonly();

$delid = htmlspecialchars($_GET['delid'], ENT_QUOTES);

$res2 = mysql_query ("SELECT id, userid FROM friends WHERE friendid =".$delid) or sqlerr();

while ($arr = mysql_fetch_assoc($res2))
{
     if ($arr['userid'] == $CURUSER['id']) {
		mysql_query ("DELETE FROM friends WHERE friendid =". $delid) or sqlerr();
	}else {
		show_error_msg("Error!","ID not found in your friends list...",1);
	}
}


header("Refresh: 0; url=" . $_SERVER['HTTP_REFERER']);
?>
Return current item: H-tracker