Просмотр файла banlist.php

Размер файла: 1.48Kb
<?php
require('ini.php');
if(!isset($_SESSION['sgb_admp'])){ header('Location: index.php'.psid()); exit; }
$bf=file('ban.dat');
if(isset($_GET['n'])){
 $n=intval($_GET['n']);
 unset($bf[$n]);
 $f=fopen('ban.dat','w');
 $d=implode('',$bf);
 fputs($f,$d);
 fclose($f);
 Header('Location: banlist.php'.psid());
 exit;
}
Header('Cache-Control: no-cache, must-revalidate');
Header('Content-Type:application/xhtml+xml;charset=utf-8');
echo('<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE html PUBLIC "-//WAPFORUM//DTD XHTML Mobile 1.0//EN" "http://www.wapforum.org/DTD/xhtml-mobile10.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="ru"><head><title>Бан-лист</title>
<link rel="stylesheet" type="text/css" href="style.css" /></head><body><div>');
if(empty($bf[0])) die('Лист пуст.<hr />[<a href="index.php'.psid().'">B гocтeвую</a>]</div></body></html>');
print('<i>(Method :: Value)</i><hr />');
$cnt=count($bf);
for($i=0;$i<$cnt;$i++){
 $a=explode('|:|',$bf[$i]);
 print('[<a href="banlist.php?n='.$i.'&amp;'.SID.'">X</a>] ');
 switch($a[0]){
  case 0:
   print('IP+Br');
  break;
  case 1:
   print('Br');
  break;
  case 2:
   print('IP');
  break;
  case 3:
   print('C. ip+br');
  break;
  case 4:
   print('C. br');
  break;
  case 5:
   print('C. ip');
  break;
  case 6:
   print('Total Ban');
  break;
 }
 print(' :: '.$a[1].'<hr />');
}
echo('[<a href="index.php?'.psid().'">B гocтeвую</a>]</div></body></html>');
?>