<?php

require_once $_SERVER['DOCUMENT_ROOT'].'/sts/config.php'; //Подключаемся к БД

if (isset($_POST["submit"]) && isset($_POST["msg"]))
{

$msg = $_POST['msg'];
$msg = htmlspecialchars(stripslashes($msg));
$msg = nl2br($msg);


$query = "INSERT INTO `main_rtr` (`text`)
			VALUES('$msg')";
										
if(mysql_query($query))
{
	echo "Текст:<br/>";
	echo "<b>".$msg."</b>";
	echo "<br/>Успешно добавлен";
}

else
{
	echo "Ошибка при добавлении!\n";
}

}
else echo "TIME = ".date ('H : i : s' )."\n";

?>

<html>
<head>
<meta name="robots" content="noindex,nofollow">
</head>
<body>

<center>
<form action="add.php" method="post">

<br>Текст: <br/><textarea cols="70" rows="5" name="msg"></textarea><br/>
<input type="submit" name="submit" value="Добавить">
</form>

</center>



</body>
</html>