发表时间:2014-09-05来源:网络
<?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==''){
alert("文章摘要不能为空");
article.zhaiyao.focus();
return false;
}
if(article.author.value==''){
alert("文章作者不能为空");
article,author.focus();
return false;
}
if(article.keyword.value==''){
alert("文章关键字不能为空");
article.keyword.focus();
return false;
}
if(article.content.value.length>20){
alert("文章内容不能少于20个字");
article.content.focus();
return fasle
}
}
</script>
</head>
<body>
<div id="main">
后台管理->添加文章
<form name="article" method="post" action="" onsubmit="return vaArticle(this)">
<div class="msg-box">
<ul class="viewmess">
<li class="light-row">
<span class="col_width">添加文章</span>
</li>
<li class="dark-row">
<span class="col_width">文章标题 <span class="red_font">*</span></span>
<input type="text" class="text-box" name="title" size="30" maxlength="40">
</li>
<li class="light-row">
<span class="col_width">文章来源URL<span class="red_font">*</span></span>
<input type="text" class="text-box" name="url" size="30" > 如自己更改请注意格式.没有可以不填
</li>
<li class="dark-row">
<span class="col_width" style="margin-top:25px">文章摘要</span>
<textarea class="text-box" name="zhaiyao" cols="40" rows="4"></textarea> 小于100个汉字.
</li>
<li class="light-row">
<span class="col_width">文章作者 <span class="red_font">*</span></span>
<input type="text" class="text-box" name="author" size="15" maxlength="20">
</li>
<li class="dark-row">
<span class="col_width">文章来源</span>
<input type="text" class="text-box" name="laiyuan" size="25" maxlength="25">
</li>
<li class="light-row">
<span class="col_width">关键字 <span class="red_font">*</span></span>
<input type="text" class="text-box" name="keyword" size="25" maxlength="20"> 用于文章搜索,多个请用逗号","隔开.
</li>
<!--<li class="dark-row">
<span class="col_width">是否推荐</span>
<input type="radio" name="recommend" value="1"> 推荐
<input type="radio" name="recommend" value="0"> 不推荐
</li>-->
<li style="margin:0px; padding:0px">
<?php echo $FCKeditor->Create(); ?>
</li>
<li class="dark-row">
<span class="col_width"> </span>
<input type="hidden" name="action" value="add">
<input type="submit" class="button" name="mod" value="添加">
<input type="reset" class="button" value="重 置">
</li>
</ul>
</div>
</form>
</div>
</body>
</html>
<?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==''){
alert("文章摘要不能为空");
article.zhaiyao.focus();
return false;
}
if(article.author.value==''){
alert("文章作者不能为空");
article,author.focus();
return false;
}
if(article.keyword.value==''){
alert("文章关键字不能为空");
article.keyword.focus();
return false;
}
if(article.content.value.length>20){
alert("文章内容不能少于20个字");
article.content.focus();
return fasle
}
}
</script>
</head>
<body>
<div id="main">
后台管理->添加文章www.zhishiwu.com
<form name="article" method="post" action="" onsubmit="return vaArticle(this)">
<div class="msg-box">
<ul class="viewmess">
<li class="light-row">
<span class="col_width">添加文章</span>
</li>
<li class="dark-row">
<span class="col_width">文章标题 <span class="red_font">*</span></span>
<input type="text" class="text-box" name="title" size="30" maxlength="40">
</li>
<li class="light-row">
<span class="col_width">文章来源URL<span class="red_font">*</span></span>
<input type="text" class="text-box" name="url" size="30" > 如自己更改请注意格式.没有可以不填
</li>
<li class="dark-row">
<span class="col_width" style="margin-top:25px">文章摘要</span>
<textarea class="text-box" name="zhaiyao" cols="40" rows="4"></textarea> 小于100个汉字.
</li>
<li class="light-row">
<span class="col_width">文章作者 <span class="red_font">*</span></span>
<input type="text" class="text-box" name="author" size="15" maxlength="20">
</li>
<li class="dark-row">
<span class="col_width">文章来源</span>
<input type="text" class="text-box" name="laiyuan" size="25" maxlength="25">
</li>
<li class="light-row">
<span class="col_width">关键字 <span class="red_font">*</span></span>
<input type="text" class="text-box" name="keyword" size="25" maxlength="20"> 用于文章搜索,多个请用逗号","隔开.
</li>
<!--<li class="dark-row">
<span class="col_width">是否推荐</span>
<input type="radio" name="recommend" value="1"> 推荐
<input type="radio" name="recommend" value="0"> 不推荐
</li>-->
<li style="margin:0px; padding:0px">
<?php echo $FCKeditor->Create(); ?>
</li>
<li class="dark-row">
<span class="col_width"> </span>
<input type="hidden" name="action" value="add">
<input type="submit" class="button" name="mod" value="添加">
<input type="reset" class="button" value="重 置">
</li>
</ul>
</div>
</form>
</div>
</body>
</html>
CI框架连接数据库配置操作以及多数据库操作
asp 简单读取数据表并列出来 ASP如何快速从数据库读取大量数据
C语言关键字及其解释介绍 C语言32个关键字详解
C语言中sizeof是什么意思 c语言里sizeof怎样用法详解
PHP中的魔术方法 :__construct, __destruct , __call, __callStatic,__get, __set, __isset, __unset , __sleep,
PHP中的(++i)前缀自增 和 (i++)后缀自增
将视频设置为Android手机开机动画的教程
最简单的asp登陆界面代码 asp登陆界面源代码详细介绍
常用dos命令及语法
PHP中include和require区别之我见
溧阳论坛触屏版手机版下载v5.4.2.18 安卓版
68.37MB |生活服务
保利悠悦荟最新版app2026下载v3.1.6 安卓版
35.73MB |生活服务
i泰达官方版下载v2.0.10 安卓版
66.01MB |生活服务
与糖医护手机版下载v4.2.0 安卓版
46.54MB |生活服务
智慧宫翻译阿拉伯语手机版下载v1.91.0 安卓版
50.68MB |生活服务
专注清单app下载v15.9 安卓版
42.61MB |生活服务
物性表手机版下载v2.3.0 安卓版
71.12MB |商务办公
hooli留学公寓app下载v5.6.1 安卓官方版
28.64MB |生活服务
2014-09-05
2022-03-20
2022-03-21
2022-03-24
2014-09-05
2014-09-05
2015-07-05
2014-09-05
2022-03-21
2014-09-05