文章推荐系统(二)


Posted in PHP onOctober 09, 2006

======APPRE.PHP==========
$strlen=strlen($articlemsg);
if($strlen<50){
  echo "<table align=center width=100%>";
  echo "<tr align=center><td>";
  echo"你是不是在灌水呀?为防止部分网友善意的灌水,本站规定你所提交的文章";
  echo"</td></tr>";
  echo"<tr align=center><td>";
  echo"的长度必须大于50个汉字。请你重新提交文章。谢谢";
  echo"</td></tr>";
  echo"<tr><td align=center>";
  echo"<a href=appre.htm>【重新提交文章】</a>   ";
  echo"<a href=index.php>【返回到主页】</a>";
  echo"</td></tr>";
  echo"</table>";
  echo"<table border=0 cellpadding=5 cellspacing=0 width=100% bgcolor=00FF00>";
  echo"<tr>";
  echo"<td width=20%>|      <a href=index.php>返回首页 </a>     </td>";
  echo"<td width=20%> | <a href=help.htm> 推荐说明</a> 
          |</td>";
  echo"<td width=20%>   <a href=#>搜索文章 </a> 
          |      </td>";
  echo"<td width=20%>  <a href=article.php>阅读文章</a>    
          |</td>";
  echo"<td width=20%>  <a href=mailto:webinfro@163.com>联系站长</a> 
          |</td>";
  echo"</tr>";
  echo"</table>";

  exit;
}
$strlen=strlen($name);
if($strlen<=1){
  echo"<table align=center width=100%>";
  echo"<tr align=center><td>";
  echo"请你正确输入你的名字";
  echo"</td></tr>";
  echo"<tr><td align=center>";
  echo"【<a href=appre.htm>重新提交文章</a>】    ";
  echo"【<a href=index.php>返回主页</a>】";
  echo"</td></tr>";
  echo"</table>";
  echo"<table border=0 cellpadding=5 cellspacing=0 width=100% bgcolor=00FF00>";
  echo"<tr>";
  echo"<td width=20%>|      <a href=index.php>返回首页 </a>     </td>";
  echo"<td width=20%> | <a href=help.htm> 推荐说明</a> 
          |</td>";
  echo"<td width=20%>   <a href=#>搜索文章 </a> 
          |      </td>";
  echo"<td width=20%>  <a href=article.php>阅读文章</a>    
          |</td>";
  echo"<td width=20%>  <a href=mailto:webinfro@163.com>联系站长</a> 
          |</td>";
  echo"</tr>";
  echo"</table>";

  exit;
}
@$conn=mysql_connect("localhost","user","password");
mysql_select_db("bamboo");
$sql="select*from article where articlename='$articlename'";
$result=mysql_query($sql,$conn);
if($result){
  if(mysql_fetch_object($result)){
    echo"<table align=center width=100%>";
    echo"<tr><td align=center>";
    echo"你所推荐的文章已经存在了";
    echo"</td>";
    echo"<td align=center>";
    echo"<a href=appre.htm>重新推荐下一篇文章</a>";
    echo"</td></tr>";
    echo"<tr><td align=center>";
    echo"如果你确信本站没有你所推荐的文章,请你点<a href=mailto:webinfro@163.com>这里</a>与此同时Bamboo联系";
    echo"</td></tr>";
    echo"<tr><td align=center>";
    echo"【<a href=appre.htm>重新发表新的文章</a>】";
    echo"【<a href=index.php>返回主页</a>】";
    echo"</td></tr>";
    echo"</table>";
    mysql_close($conn);
    echo"<table border=0 cellpadding=5 cellspacing=0 width=100% bgcolor=00FF00>";
    echo"<tr>";
    echo"<td width=20%>|      <a href=index.php>返回首页 </a>     </td>";
    echo"<td width=20%> | <a href=help.htm> 推荐说明</a> 
          |</td>";
    echo"<td width=20%>   <a href=#>搜索文章 </a> 
          |      </td>";

    echo"<td width=20%>  <a href=article.php>阅读文章</a>    
          |</td>";
    echo"<td width=20%>  <a href=mailto:webinfro@163.com>联系站长</a> 
          |</td>";
    echo"</tr>";
    echo"</table>";

    exit;}
    }
$sql="select *from article where name=$name";
$result=mysql_query($sql,$conn);
if($result){
  if(mysql_fetch_object($result)){
  echo"<table width=100% align=center>";
  echo"<tr align=center>";
  echo"<td align=center>";
  echo"本站数据库记录显示已经有一个和你同名的记录,请你换一个名字重新发表文章";
  echo"</td></tr>";
  echo"<tr><td align=center>";
  echo"<a href=appre.htm>重新发表文章</a>";
  echo"<a href=index.php>返回主页</a>";
  echo"</td></tr>";
  echo"</table>";
  mysql_close($conn);
  echo"<table border=0 cellpadding=5 cellspacing=0 width=100% bgcolor=00FF00>";
  echo"<tr>";
  echo"<td width=20%>|      <a href=index.php>返回首页 </a>     </td>";
  echo"<td width=20%> | <a href=help.htm> 推荐说明</a> 
          |</td>";
  echo"<td width=20%>   <a href=#>搜索文章 </a> 
          |      </td>";
  echo"<td width=20%>  <a href=article.php>阅读文章</a>    
          |</td>";
  echo"<td width=20%>  <a href=mailto:webinfro@163.com>联系站长</a> 
          |</td>";
  echo"</tr>";
  echo"</table>";

  exit;
  }
}

echo $webadd1;
$sql="insert into article(name,webname,webadd,weblogo,articlename,articleauthor,articlemsg) values ('$name','$webname','$webadd','$weblogo','$articlename'
,'$articleauthor'
,'$articlemsg'
)";
//echo mysql_errno().":".mysql_error()."<br>";
if(mysql_query($sql,$conn)){
  echo"<table width=100% align=center>";
  echo"<tr><td align=center>";
  echo"谢谢你,斑竹园的发展离不开你的支持。你提交的文章已经接受";
  echo"</td></tr>";
  echo"<tr><td align=center>";
  echo"【<a href=appre.htm>提交另一篇文章</a>】";
  echo"【<a href=index.php>返回主页</a>】";
  echo"</td></tr>";
  echo"</table>";
  mysql_close($conn);
  }
else{
  echo"<table width=100% align=center>";
  echo"<tr><td align=center>";
  echo"对不起,你提交的文章出现错误,请你重新提交";
  echo"</td></tr>";
  echo"<tr><td align=center>";
  echo"【<a href=appre.htm>重新提交</a>】";
  echo"【<a href=index.php>返回主页</a>】";
  echo"</td></tr>";
  echo"</table>";
  mysql_close($conn);
  }
  echo"<table border=0 cellpadding=5 cellspacing=0 width=100% bgcolor=00FF00>";
  echo"<tr>";
  echo"<td width=20%>|      <a href=index.php>返回首页 </a>     </td>";
  echo"<td width=20%> | <a href=help.htm> 推荐说明</a> 
          |</td>";
  echo"<td width=20%>   <a href=#>搜索文章 </a> 
          |      </td> ";
  echo"<td width=20%>  <a href=article.php>阅读文章</a>    
          |</td>";
  echo"<td width=20%>  <a href=mailto:webinfro@163.com>联系站长</a> 
          |</td>";
  echo"</tr>";
  echo"</table>";

?>

PHP 相关文章推荐
第十三节 对象串行化 [13]
Oct 09 PHP
dede3.1分页文字采集过滤规则详说(图文教程)续四
Apr 03 PHP
phpmyadmin MySQL 加密配置方法
Jul 05 PHP
php cache类代码(php数据缓存类)
Apr 15 PHP
php中如何判断一个网页请求是ajax请求还是普通请求
Aug 10 PHP
提高PHP编程效率的方法
Nov 07 PHP
php截取中文字符串不乱码的方法
Dec 25 PHP
解决Codeigniter不能上传rar和zip压缩包问题
Mar 07 PHP
PHP使用CURL实现对带有验证码的网站进行模拟登录的方法
Jul 23 PHP
PHP调试及性能分析工具Xdebug详解
Feb 09 PHP
PHP自定义函数判断是否为Get、Post及Ajax提交的方法
Jul 27 PHP
TP5(thinkPHP5框架)实现显示错误信息及行号功能的方法
Jun 03 PHP
谈谈PHP语法(5)
Oct 09 #PHP
谈谈PHP语法(4)
Oct 09 #PHP
谈谈PHP语法(3)
Oct 09 #PHP
PHP 和 MySQL 基础教程(四)
Oct 09 #PHP
无数据库的详细域名查询程序PHP版(5)
Oct 09 #PHP
无数据库的详细域名查询程序PHP版(4)
Oct 09 #PHP
PHP 和 MySQL 基础教程(三)
Oct 09 #PHP
You might like
php目录管理函数小结
2008/09/10 PHP
php自定义错误处理用法实例
2015/03/20 PHP
php ajax实现文件上传进度条
2016/03/29 PHP
PHP面向对象程序设计方法实例详解
2016/12/24 PHP
解决form中action属性后面?传递参数 获取不到的问题
2017/07/21 PHP
IE6图片加载的一个BUG解决方法
2010/07/13 Javascript
解决Extjs上传图片无法预览的解决方法
2012/03/22 Javascript
基于jquery的禁用右键、文本选择功能、复制按键的实现代码
2013/08/27 Javascript
在JavaScript中处理字符串之fontcolor()方法的使用
2015/06/08 Javascript
javascript this详细介绍
2016/09/19 Javascript
ComboBox(下拉列表框)通过url加载调用远程数据的方法
2017/08/06 Javascript
vue 中引用gojs绘制E-R图的方法示例
2018/08/24 Javascript
Vue唯一可以更改vuex实例中state数据状态的属性对象Mutation的讲解
2019/01/18 Javascript
vue自定义指令和动态路由实现权限控制
2020/08/28 Javascript
vue 路由meta 设置导航隐藏与显示功能的示例代码
2020/09/04 Javascript
[01:12]快闪回顾DOTA2亚洲邀请赛(DAC) 静候2018新征程开启
2018/03/11 DOTA
[01:32:50]DOTA2-DPC中国联赛 正赛 DLG vs XG BO3 第一场 1月25日
2021/03/11 DOTA
Linux下将Python的Django项目部署到Apache服务器
2015/12/24 Python
Python读写Json涉及到中文的处理方法
2016/09/12 Python
python GUI实例学习
2017/11/21 Python
python调用tcpdump抓包过滤的方法
2018/07/18 Python
python3爬虫获取html内容及各属性值的方法
2018/12/17 Python
8种用Python实现线性回归的方法对比详解
2019/07/10 Python
利用Python如何画一颗心、小人发射爱心
2021/02/21 Python
html5使用canvas绘制一张图片
2014/12/15 HTML / CSS
详解px单位html5响应式方案
2018/03/08 HTML / CSS
Tory Burch美国官方网站:美国时尚生活品牌
2016/08/01 全球购物
SkinCeuticals官网:美国药妆品牌
2018/04/19 全球购物
请说出以下代码输出什么
2013/08/30 面试题
工程地质勘察专业大学生求职信
2013/10/13 职场文书
对标管理实施方案
2014/03/12 职场文书
酒店端午节活动方案
2014/08/26 职场文书
生产现场禁烟通知
2015/04/23 职场文书
婚礼上证婚人致辞
2015/07/28 职场文书
毕业晚宴祝酒词
2015/08/11 职场文书
Canvas绘制像素风图片的示例代码
2021/09/25 HTML / CSS