【php开源代码栏目提醒】:本文主要为网学会员提供editnews.php,希望对需要editnews.php网友有所帮助,学习一下!
<?php
require("auth.php");
function edit_news($id,$subject,$news){
global $PHP_AUTH_USER;
global $
PHP_AUTH_PW;
$datetime = date("m/d/y \a\\t h:i a");
require("functions.php");
$news = smilie($news);
$news = addslashes($news);
db_connect();
$sqledit = "UPDATE fubonews SET news='$news',datetime='$datetime' where id='$id'";
if(mysql_query($sqledit)){
$title = "新闻编辑成功";
include("header.php");
echo "新闻编辑成功<br>
<a href=\"index.php\">返回功能菜单</a>";
}
elseif(!my
sql_query($sqledit)){
mysql_error() . "<br>不能编辑新闻";
}
mysql_close();
}
edit_news($id,$subject,$news);
?>