Location: PHPKode > projects > EasyFest > new/admin_deleteUser.php
<?php
include_once("include/db_connection.php");
	header("Expires: Thu, 17 May 2001 10:17:17 GMT");    // Date in the past
	header ("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT"); // always modified
	header ("Cache-Control: no-cache, must-revalidate");  // HTTP/1.1
	header ("Pragma: no-cache");                          // HTTP/1.0              
	session_start();
		if($_SESSION["adminloggedIn"] == FALSE){
		header("Location:admin_login.php");
		exit;
	}

//$sql1="SELECT * FROM $tbl_name ORDER BY (id) DESC";
// OREDER BY id DESC is order result by descending
//$result=mysql_query($sq1l);
//$result = MYSQL_QUERY($sql1);
?>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252" />
<title>Easy Fest</title>
</head>
<body>
<?php
$UserName1=$_GET['UserName'];
//$result1 = mysql_fetch_array(mysql_query("SELECT a_name from $TableName WHERE question_id=$id"));
//$query="DELETE from Polls WHERE PollId=$PollId";
$query1=mysql_fetch_array(mysql_query("select * FROM users WHERE UserName='$UserName1'"));
//if($UserName==$query1[0] || $UserName==$result1['a_name']){
//$query = mysql_query("DELETE FROM forum_question WHERE id=$id");

$query3= mysql_query("DELETE from rights where UserName='$UserName1'");

$n=$_POST[dnhjbfhjbsjfhbjsfbjsfbsfjhfbhjfbj];

if (is_null($n))
$n = 'NULL';
else
$n = "'$n'";


 if($query1['Type']==1)
{
 $query4= mysql_query("UPDATE events SET EventAssociate=".$n." WHERE EventAssociate='$UserName1'";
}
else if($'Type']==2)
{
 $query4= mysql_query("UPDATE events SET EventHead='$n' WHERE EventHead='$UserName1'";
}
else if($query1['Type']==3)
{
 $query4= mysql_query("UPDATE events SET EventCoord1='$n' WHERE EventCoord1='$UserName1'";
 $query5= mysql_query("UPDATE events SET EventCoord2='$n' WHERE EventCoord2='$UserName1'";
 $query6= mysql_query("UPDATE events SET EventCoord3='$n' WHERE EventCoord3='$UserName1'";
 $query7= mysql_query("UPDATE events SET EventCoord4='$n' WHERE EventCoord4='$UserName1'";
 $query8= mysql_query("UPDATE events SET EventCoord5='$n' WHERE EventCoord5='$UserName1'";
}
$query2= mysql_query("DELETE from users where UserName='$UserName1'");


//$query2=mysql_query("Drop table $TableName");
//$UserName=$_GET[UserName];
//$query2=mysql_query("Drop table $TableName");*/ 
?>
<script type="text/javascript">
<!--
window.location = "admin_viewUsers.php"; 
//-->
</script>	
<?php }
else
{
echo "you are not authorised to delete ";
}
?>
Return current item: EasyFest