Просмотр файла forum/delpost.php

Размер файла: 1.23Kb
<?
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, admin from users where id='$UIN'";
$res=mysql_query($sql);
$row=mysql_fetch_object($res);
if ($pass!=$row->pass)
{
$UIN="Guest";
}
else 
{
$ad=$row->admin;
}

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



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

 }
      

else { 
?>ad=<?=$ad?>
<?
echo 'Access denined';

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