【php开源代码栏目提醒】:网学会员为广大网友收集整理了,edit_news.php,希望对大家有所帮助!
<?php
include("global.php");
?>
<html>
<head>
<link type="text/css" rel="stylesheet" href="style.css">
<script language="javacript" type="text/javascript">
function check_content() {
var title=document.artical_edit.title.value;
if(title == '') {
alert("请你输入文章标题!");
return false;
}
}
</script>
</head>
<body>
<div id="maintable">编辑文章</div>
<?php
include("../include/dbconnect.inc.php");
$id = $_GET['id'];
$sql = "select * from category";
$rs = mysql_query($sql);
echo <<<CATEFORM
<table cellspacing='0'>
<form name="artical_edit" action="art_do_edit.php" method="POST">
<tr><td> 所属栏目: </td><td> <select name='cid'>
CATEFORM;
while($row = my
sql_fetch_array($rs)) {
echo "<option value='{$row['cid']}'>{$row['name']}</option>";
}
$sql = "select * from content where id='$id'";
$rs =
mysql_query($sql);
$rows = mysql_fetch_array($rs);
echo <<<FORMEND
</select><input type="hidden" name="id" value="$id"></td>
<td> 文章标题: </td><td> <input type="text" name="title" id="title" value="{$rows['title']}" size="50"></td></tr>
<tr><td> 作者: </td><td> <input type="text" name="author" id="author" value="{$rows['author']}"></td>
<td> 来源: </td><td> <input type="text" name="from" id="from" value="{$rows['from']}"></td></tr>
<tr><td> 关键字: </td> <td colspan='3'><input type='text' name="key1" id="key1" value="{$rows['key1']}">
<input type="text" name="key2" id="key2" value="{$rows['key2']}">
<input type="text" name="key3" id="key3" value="{$rows['key3']}"></td></tr><td colspan=4>
<input id=content style="DISPLAY: none" type=hidden name="body" value="{$rows['body']}">
<input id=content___Config style="DISPLAY: none" type=hidden >
<iframe id=content___Frame src="../include/fckeditor/editor/fckeditor.html?InstanceName=body&Toolbar=Default" frameBorder=0 width=100% scrolling=no height=450>
</iframe></td></tr></table><br>
<center><input type="submit" name="submit" value=" 编辑 " onclick="return check_content();"><input type="reset" name="reset" value=" 取消 "></center>
</form>
FORMEND
?>
</body></html>