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

Размер файла: 1.14Kb
<?php
@$pas=$_GET['pas'];
@$t=$_GET['t'];
@$n=$_GET['n'];
require('ini.php');
Header('Content-type: application/xhtml+xml;charset=utf-8');
Header('Cache-control: no-cache, must-revalidate');
print'<?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>Delete</title><link rel="stylesheet" type="text/css" href="style.css" /></head><body><div>';
if($pas==$admp && $t!='' && $n!=''){
$arr=file('themes.dat');
$sarr=explode(':||:',$arr[$t]);
$arr2=file('data/'.$sarr[0]);
$cnt=count($arr2);
if($n==$cnt-1){
$lna=explode(':||:',$arr2[$cnt-2]);
$sarr[2]=$lna[0];
}
$sarr[4]=($cnt-1)."\n";
$arr[$t]=implode(':||:',$sarr);
$f=fopen('themes.dat','w');
$d=implode('',$arr);
fputs($f,$d);
fclose($f);
$arr2[$n]='';
$f=fopen('data/'.$sarr[0],'w');
$d=implode('',$arr2);
fputs($f,$d);
fclose($f);
print'Сообщение удалено.<br />';
}
else{print'Ошибка.<br />';}
print'[<a href="view.php?pas='.$pas.'&amp;n='.$t.'">Вернуться</a>]</div></body></html>';
?>