📄 edit_article.php
字号:
<?session_start();
require"./inc/func.php";
check_login();
mscon();
if(!$id)
{
echo "您要编辑的文章不存!";
exit();
}
if($sub)
{
if($html<>2)
{
$title=htmlspecialchars($title);
$cont=htmlspecialchars($cont);
}
$query="update $table set title='$title',cont='$cont',time='$time' where id='$id'";
$res=mysql_db_query("$database",$query);
if(mysql_affected_rows()>0)
{
echo "<script>alert(\"文章已经修改成功!\");window.close();</script>";
exit();
}
else
{
echo "<script>alert(\"文章已经修改失败,可能是数据库的问题,请稍后再来!\");window.close();</script>";
exit();
}
}
else
{
$query="select * from $table where id='$id'";
$res=mysql_db_query("$database",$query);
if(mysql_num_rows($res)>0)
$data=mysql_fetch_array($res);
else
{
echo "您要编辑的文章不存或已删除!";
exit();
}
}
require "./inc/header.inc";
?>
</head>
<body bgcolor="#FFFFFF">
<? require "./inc/nav.inc";?>
<form method="post" action="<? echo $php_self;?>">
加入日期:<input type="text" name="time" value="<?php echo $data[time];?>">
正文内容: 不支持html:<input type="radio" name="html" value="1" checked>
支持html:<input type="radio" name="html" value="2">
<br>
文章标题:<input type="text" name="title" value="<?php echo $data[title];?>" size=60>
<input type="hidden" name="id" value="<?php echo $data[id];?>">
<br>
<textarea name="cont" cols="91" rows="28"><?php echo $data[cont];?></textarea>
<br>
<center>
<input type="submit" name="sub" value="确定修改">
<input type="button" value="取消修改" onclick=window.close();>
</center>
</form>
<font color="#FFFFFF"></font>
<?require "./inc/footer.inc";?>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -