<?php
session_start();
include("config.php");
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
<head>
<title>bglife</title>
<meta http-equiv="Content-Type" content="text/html; charset=windows-1251" />
<link rel="stylesheet" href="style.css" type="text/css" />
</head>
<body>
<table align="center" id="head">
<img src="images/logo.gif" borer="0" />
</table>
<table align="center" id="center">
<tr>
<td id="menu">
<? include("menu.php"); ?>
</td>
<td><div id="main">
<p>
<!Banner 468x60>
<?php
if (!isset($_POST['submit'])) {
?>
<form action="<?php echo $_SERVER['PHP_SELF']; ?>" method="post">
Заглавие на новината:<br/>
<input type="text" name="title" size="40"/><br/><br/>
Съдържание:<br/>
<textarea name="newstext" rows="15" cols="67"></textarea><br/>
<center><input type="submit" name="submit" value="Запази" /></center>
</form>
<?php } else {
$newsTitel = isset($_POST['title']) ? $_POST['title'] : 'Untitled';
$submitDate = date('Y-m-d g:i:s A');
$newsContent = isset($_POST['newstext']) ? $_POST['newstext'] : 'No content';
$filename = date('YmdHis');
$f = fopen('../admin/'.$filename.".txt","w+");
fwrite($f,$newsTitel."\n");
fwrite($f,$submitDate."\n");
fwrite($f,$newsContent."\n");
fclose($f);
header('Location:../../index.php');
}
?>
</p>
<a href="../map.php">Карта</a>
</div></td>
<td id="ad">
<!Banner 120x240><br /><!Banner 120x240>
</td>
</tr>
</table>
<table align="center" id="baner">
<a href="http://beron.host-bg.info"><img src="images/baner.png" borer="0" /></a>
</table>
<!Banner 768x90>
</body>
</html>