Location: PHPKode > projects > Admbook > admin/delete.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 (!isset($id))
	{
		Header("Location: index.php?page=".$page);exit;
	}
	if (file_exists("../content-data.php"))
		include("../content-data.php");
	$contentCnt = sizeof($content);
	$newContent = "<?php\n";
	$z = 0;
	for($i = 0; $i < sizeof($id); $i++)
	{
		if (!isset($content[$id[$i]-1]))
		{
			session_destroy();
			Header("Location: login.php");exit;
		}
		$content[$id[$i]-1]['ip'] = "";
	}
	for($i = 0; $i < $contentCnt; $i++)
	{
		if ($content[$i]['ip'] != "")
		{
			while(list($key, $value) = each($content[$i]))
			{
				$newContent .= "\t\$content[".$z."]['".$key."'] = \"".$value."\";\n";
			}
			if ($i != $contentCnt-1)
				$newContent .= "\n";
			$z++;
		}
	}
	$newContent .= "?>";
	reWriteDataInFile ($newContent,"../content-data.php");
	$timer->stop();
	Header("Location: index.php?".$timer->elapsed());exit;
?>
Return current item: Admbook