View file mforum/deltop.php

File size: 635B
<?php
	$pid=$HTTP_GET_VARS['pid'];
	$page=$HTTP_GET_VARS['page'];
	require "inc.php";
	$myid=$_COOKIE["usid"];
	$mypass=$_COOKIE["pass"];
	$db=mysql_connect($dbhost, $dbuser, $dbpass);
	mysql_select_db($dbname,$db);
	if (!isset($myid)) $myid=0;
	$sqlc="select * from users where usid=$myid";
	$c=mysql_query($sqlc);
	$resc=mysql_fetch_array($c);
	if ($resc[pass]==$mypass)
	{
		if ($resc[usid]==1) 
		{
			$sqld="DELETE FROM forum WHERE pid='$pid' LIMIT 1";
			$a=mysql_query($sqld);
			$sqld="DELETE FROM replies WHERE pid='$pid'";
			$a=mysql_query($sqld);
		}
	}	
	Header("Location: index.php?page=$page");
?>