コード例 #1
0
ファイル: updatenews.php プロジェクト: xiaowanzi1204/news
header("content-type:text/html;charset=utf-8");
include_once 'nologin.php';
include_once '../dbio/NewsTypes.php';
include_once '../dbio/NewsArticles.php';
$articleId = $_GET["articleId"];
$newsInfo = NewsArticles::getNewsById($articleId);
//获得表单提交的数据
$title = $_POST["title"];
$typeId = $_POST["typeId"];
$writer = $_POST["writer"];
$source = $_POST["source"];
$content = $_POST["content"];
//表单提交(修改新闻)
if ($content != NULL) {
    $result = NewsArticles::updateNews($articleId, $title, $content, $writer, $source, $typeId);
    header("location:success.php?act=updateNews&rst={$result}&articleId={$articleId}");
}
$newsTypes = NewsTypes::getNewsTypes();
//所有分类
?>
<html>
  <head>
    <title>修改新闻</title>
    <meta http-equiv="content-type" content="text/html;charset=utf-8">
    <link href="../css/admin.css" type="text/css" rel="stylesheet" />
    <script type="text/javascript" src="../jquery/jquery-1.4.js"></script>
    <script type="text/javascript" src="../kindeditor/kindeditor.js"></script>
    <script type="text/javascript">
      var editor;
      KindEditor.ready(function(e){