View file forum/del_topic.php

File size: 1.34Kb
<?
header("Content-Type: text/vnd.wap.wml");
echo '<?xml version="1.0" encoding="utf-8"?>';
echo '<!DOCTYPE wml PUBLIC "-//WAPFORUM//DTD WML 1.1//EN"
"http://www.wapforum.org/DTD/wml_1.1.xml">';
require "consts.php";
$conn=mysql_connect(my_host, my_user, my_password);
mysql_select_db(my_db, $conn);




if(isset($HTTP_GET_VARS['UIN']))
{
$UIN=$HTTP_GET_VARS['UIN'];
}
else
{
$UIN="Guest";
}
$UINmd5=$UIN;




if(isset($HTTP_GET_VARS['pass']))

{

$pass=$HTTP_GET_VARS['pass'];

}

else

{

$pass="Guest";

}






$sql="select pass, addmin from users where id='$UIN'";
$res=mysql_query($sql);
$row=mysql_fetch_object($res);
if ($pass!=$row->pass)
{
$UIN="Guest";
}
else
{
$add=$row->addmin;
}

echo '<wml>';
echo '<head>';
echo '<meta http-equiv="Cache-Control" content="no-store" forua="true"/>';
echo '</head>';
?>
<card ontimer="main.php?UIN=<?=$UINmd5?>&amp;pass=<?=$pass?>&amp;room=<?=$room?>" id="id" title="<?=$id?>">
<timer value="20"/>
<p>
<?



   
If ($add==1)
     {
      $sql="delete from topic where id='$topic'";
      mysql_query($sql);
 $sql="delete from rating where ident='$topic'";
      mysql_query($sql);
 $sql="delete from forum where topic='$topic'";
      mysql_query($sql);
     ?>
        Topic <?=$topic?> has been deleted...<br/>
        <?
          mysql_close($conn);?><?

 }
    


else { echo 'Access denined';

}
?>
</p>
</card>
</wml>