rendered paste body<?php
include("config.php");
include("conn.php");
if(empty($_POST['title'])||empty($_POST['text'])||empty($_POST['sec'])){
$msg = "missing field!";
}else{
$id=$_GET['id'];
$title=$_POST['title'];
$text=$_POST['text'];
$sec=$_POST['sec'];
$sql = "UPDATE `news` SET `news_title`='".$title."',`news_text`='".$text."',`news_sec`='".$sec."' WHERE `news_id`='".$id."';";
$result = mysql_query($sql);
if($result){
$msg = "OK";
}else{
$msg = "ERROR!";
}
mysql_close($link);
}
include("easytemplate.php");
$tpl = new EasyTemplate();
print $tpl->display("msg.tpl");
?>