View file GuestBook_by_storm/gb/adminka/otv.php

File size: 978B
<?php
include "../ini.php";
Error_reporting (0);
switch ($page)
{
default:
if ($pass_a == $_REQUEST['pass']){
echo '<div>Ответ</div>
<form action="otv.php?pass='.$_REQUEST['pass'].'&amp;id='.$_REQUEST['id'].'&amp;page=otv" method="post">
<input type="text" name="text" maxlength="250" value=""/><br/>
<input type="submit" value="Ok"/></form><br/>
<a href="panel.php?pass='.$_REQUEST['pass'].'">Назад<a/><br/>';
}
else echo "Неверный пароль!";
break;
case 'otv':
if ($pass_a == $_REQUEST['pass']){
$text = htmlspecialchars($_REQUEST['text'], ENT_QUOTES);
$id = $_REQUEST['id'];
$add = mysql_query("UPDATE posts SET otvet='$text' WHERE id='$id'");
if ($add) header('Location:otv.php?pass='.$_REQUEST['pass'].'&page=ok');
else echo "Ошибка записи";
}
else echo "Неверный пароль!";
break;
case 'ok':
echo 'Ок!<br/><a href="panel.php?pass='.$_REQUEST['pass'].'">В админку</a><br/>';
break;
}
?>