Location: PHPKode > projects > EasyFest > new/deletePoll.php
<?php
	include_once("include/db_connection.php");
	session_start();
	if($_SESSION["adminloggedIn"] == FALSE){
				header("Location:admin_login.php");
				exit;
	}
?>
<!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
$UserName=$_GET[UserName];
$PollId=$_GET[PollId];
$TableName="Poll"."$PollId";
$result1 = mysql_fetch_array(mysql_query("SELECT UserName from Polls WHERE PollId=$PollId"));
//$query="DELETE from Polls WHERE PollId=$PollId";
$query1=mysql_fetch_array(mysql_query("select UserName FROM users WHERE Type=0"));
if($result1[0]==$UserName || $UserName==$query1[0]){
$query = mysql_query("DELETE FROM Polls WHERE PollId=$PollId");
$query2=mysql_query("Drop table $TableName");?>
<script type="text/javascript">
<!--
window.location = "viewAllPoll.php?PollId=<?php echo  $PollId ;?>"
//-->
</script>	
<?php }
else
{
echo "you are not authorised to delete this poll";
}
?>
Return current item: EasyFest