php 添加文章
<?php
/**
* 添加文章
* 2011/8/21
* kcj
* */
include "isLogin.php";
include "../FCKeditor/fckeditor.php";
include "../conn/conn.php";
$FCKeditor=new FCKeditor("content");
$FCKeditor->BasePath = '../FCKeditor/';
$title=$_POST['title'];
$url=$_POST['url'];
$zhaiyao=$_POST['zhaiyao'];
$author=$_POST['author'];
$laiyuan=$_POST['laiyuan'];
$keyword=$_POST['keyword'];
$content=$_POST['content'];
if(isset($_POST['action'])!=''&&$_POST['action']="add"){
$sql="insert into article (title,url,zhaiyao,author,laiyuan,keyword,content,ctime) values
('".$title."','".$url."','".$zhaiyao."','".$author."','".$laiyuan."','".$keyword."','".$content."',now())";
mysql_query($sql);
echo "文章添加成功";
}
?>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>无标题文档</title>
<meta name="Author" content="kcj" />
<meta name="Keywords" content="php,lampbrother" />
<link rel="stylesheet" type="text/css" href="style/lampcms.css">
<script src="javascript/common.js"></script>
<script type="text/javascript">
function vaArticle(article){
if(article.title.value==''){
alert("文章标题不能为空");
article.title.focus();
return false;
}
if(article.zhaiyao.value==''){
相关新闻>>
- 发表评论
-
- 最新评论 更多>>