<?php
include '../ini.php';
head();
if ($_SESSION['id'] == 1){
$id = (isset($_GET['id']) ? intval($_GET['id']) : NULL);
$sql = mysql_query("SELECT * FROM `users` WHERE `id` = '".$id."' LIMIT 1");
mysql_query("DELETE FROM `users` WHERE `id` = '".$id."'");
unlink("../photo/".$id.".jpg");
echo 'Удалили!<br/>';
echo '<a href="index.php">В админку</a> | <a href="/">На главную</a>';
}
else {
header('Location: http://'.$_SERVER["HTTP_HOST"].'/');
}
foot();
?>