Файл: red.php
Строк: 31
<?
include './system/common.php';
include './system/functions.php';
include './system/user.php';
if(!$user) {
header('location: /');
exit;
}
$title = 'Редактирование';
include './system/h.php';
{
$id = $_GET['id'];
$result = mysql_query("SELECT `name`,`text` FROM `forum_topic` WHERE `id` = '".$id."'");
$row = mysql_fetch_assoc($result);
if(isset($_POST['save'])){
$name = strip_tags(trim($_POST['name']));
$text = strip_tags(trim($_POST['text']));
mysql_query("UPDATE `forum_topic` SET `name` = '".$name."',`text` = '".$text."' WHERE `id` = '".$id."'");
header('location: /forum/topic/'.$id.'/');
mysql_close();
}
}
?>
<div class="block_zero">
<form method="post" action="/forum/topic/red/<?=$id?>">
<div>Название топика:<br>
<input class="text medium-text" name="name" maxlength="40" value="<?=$row['name']?>" type="text">
<br>Оглавление:<br>
<textarea name="text" class="text large" rows="8" cols="60"><?=$row['text']?></textarea>
<br>
<span class="btn"><span class="end"><input class="label" name="save" value="Изменить" type="submit">Изменить</span></span>
</div>
</form>
</div>
<?
include './system/f.php';
break;
?>