Location: PHPKode > projects > Admbook > admin/censored-del.php
<?php
	class Timer {
		var $startTime;
		var $endTime;
		function start() {
			$this->startTime = gettimeofday();
		}
		function stop() {
			$this->endTime = gettimeofday();
		}
		function elapsed() {
			return (($this->endTime["sec"] - $this->startTime["sec"]) * 1000000 + ($this->endTime["usec"] - $this->startTime["usec"])) / 1000000;
		}
	}
	$timer = new Timer();
	$timer->start();
	session_start();
	include("../settings-data.php");
	include("../lib.php");
	checkPermissions($login, $password);
	if (file_exists("../dictionary-data.php"))
		include("../dictionary-data.php");
	if (!isset($id))
		$id = array();
	for($i = 0; $i < sizeof($id); $i++)
	{
		if (!isset($censor[$id[$i]-1]))
		{
			session_destroy();
			Header("Location: login.php");exit;
		}
		$censor[$id[$i]-1] = "";
	}

	$newContent = "<?php\n";
	for($i = 0; $i < sizeof($censor); $i++)
	{
		if ($censor[$i] != "")
			$newContent .= "\t\$censor[] = \"".$censor[$i]."\";\n";
	}
	$newContent .= "?>";

	reWriteDataInFile ($newContent,"../dictionary-data.php");
	$timer->stop();
	Header("Location: censored.php?".$timer->elapsed());exit;
?>
Return current item: Admbook