php网站在哪儿添加文章_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 “文章添加成功”;

}

?>

无标题文档

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

}

}

后台管理->添加文章

添加文章

文章标题 *

文章来源URL*

如自己更改请注意格式.没有可以不填

文章摘要

小于100个汉字.

文章作者 *

文章来源

关键字 *

用于文章搜索,多个请用逗号”,”隔开.

是否推荐

推荐

不推荐

–>

Create(); ?>

/**

* 添加文章

* 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 “文章添加成功”;

}

?>

无标题文档

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

}

}

后台管理->添加文章www.2cto.com

添加文章

文章标题 *

文章来源URL*

如自己更改请注意格式.没有可以不填

文章摘要

小于100个汉字.

文章作者 *

文章来源

关键字 *

用于文章搜索,多个请用逗号”,”隔开.

是否推荐

推荐

不推荐

–>

Create(); ?>

摘自 chaojie2009的专栏

www.bkjia.comtrueTechArticle?php /** * 添加文章 * 2011/8/21 * kcj * */ include isLogin.php; include ../FCKeditor/fckeditor.php; include ../conn/conn.php; $FCKeditor=new FCKeditor(content); $FCKeditor-Base…

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值