Просмотр файла mini-top/del.php

Размер файла: 983B
<?php
	include 'a.php';
	include 'ini.php';

 if (!isset($_POST['m']) && !isset($_POST['d'])) {
   $wml.= '<form action="del.php" method="POST">
Your Name<br />
<input name="m" /><br />
Del ID from Top<br />
<input name="d" format="*N" maxlength="5" /><br />
<input type="submit" value="Ok!" />
</form>
';
} else {
	$d= (int) $_POST['d'];
	$m= $_POST['m'];
	if ($m==$password) {if ($d!==0) {
		$fs= filesize('data.txt');
		$f= fopen('data.txt', 'a+');
		fseek($f, 0);
		flock($f, LOCK_EX);
		$tmp= fread($f, $fs);
		$rat= unserialize($tmp);
		unset($rat[$d]);
		ftruncate($f, 0);
		fwrite($f, serialize($rat));
		flock($f, LOCK_UN);
		fflush($f);
		fclose($f);
		$wml.= '<p><a href="del.php?'.rand(1, 999).'">Ok!</a><br />';
	}
	} else header('Location: http://visavi.net/');
}

$wml.= '---<br />
<a href="rating.php">Рейтинг</a><br />
<a href="'.$site_addr.'">На Главную</a><br />';

$wml.= '</p></body></html>';
echo $wml;
?>