文章推荐系统(二)


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 相关文章推荐
PHP+JS无限级可伸缩菜单详解(简单易懂)
Jan 02 PHP
可以在线执行PHP代码包装修正版
Mar 15 PHP
用phpmyadmin更改mysql5.0登录密码
Mar 25 PHP
php文章内容分页并生成相应的htm静态页面代码
Jun 07 PHP
php生成随机密码的三种方法小结
Sep 04 PHP
《PHP编程最快明白》第二讲 数字、浮点、布尔型、字符串和数组
Nov 01 PHP
php中用数组的方法设置cookies
Apr 21 PHP
jQuery中的RadioButton,input,CheckBox取值赋值实现代码
Feb 18 PHP
PHP中设置一个严格30分钟过期Session面试题的4种答案
Jul 30 PHP
php解析json数据实例
Aug 19 PHP
PHP实现登录搜狐广告获取广告联盟数据的方法【附demo源码】
Oct 14 PHP
PHP数组对象与Json转换操作实例分析
Oct 22 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实现无限级分类(递归方法)
2015/08/06 PHP
PHP实现的限制IP投票程序IP来源分析
2016/05/04 PHP
js的event详解。
2006/09/06 Javascript
JS backgroundImage控制
2009/05/19 Javascript
JS中prototype关键字的功能介绍及使用示例
2013/07/21 Javascript
关于extjs4如何获取grid修改后的数据的问题
2013/08/07 Javascript
jquery实现点击label的同时触发文本框点击事件的方法
2015/06/05 Javascript
Jquery实现弹性滑块滑动选择数值插件
2015/08/08 Javascript
浅谈angularJS的$watch失效问题的解决方案
2017/08/11 Javascript
js判断文件类型大小并给出提示的实现方法
2018/01/03 Javascript
关于vue中 $emit的用法详解
2018/04/12 Javascript
element UI upload组件上传附件格式限制方法
2018/09/04 Javascript
javascript写一个ajax自动拦截并下载数据代码实例
2019/09/07 Javascript
JS call()及apply()方法使用实例汇总
2020/07/11 Javascript
基于vue hash模式微信分享#号的解决
2020/09/07 Javascript
[02:04]2016国际邀请赛中国区预选赛VG.R晋级之路
2016/07/01 DOTA
python写的一个文本编辑器
2014/01/23 Python
python logging类库使用例子
2014/11/22 Python
python创建一个最简单http webserver服务器的方法
2015/05/08 Python
Python监控主机是否存活并以邮件报警
2015/09/22 Python
详解django的serializer序列化model几种方法
2018/10/16 Python
python selenium执行所有测试用例并生成报告的方法
2019/02/13 Python
使用Nibabel库对nii格式图像的读写操作
2020/07/01 Python
Python制作数据预测集成工具(值得收藏)
2020/08/21 Python
CSS3实现淘宝留白的方法
2020/06/05 HTML / CSS
俄罗斯一家时尚女装商店:Charuel
2019/12/04 全球购物
法国亚马逊官方网站:Amazon.fr
2020/12/19 全球购物
城市精细化管理实施方案
2014/03/04 职场文书
十佳标兵事迹材料
2014/08/18 职场文书
网络工程专业大学生求职信
2014/10/01 职场文书
中国世界遗产导游词
2015/02/13 职场文书
学校计划生育责任书
2015/05/09 职场文书
网络妈妈观后感
2015/06/08 职场文书
2016年优秀少先队员事迹材料
2016/02/26 职场文书
详解MySQL的Seconds_Behind_Master
2021/05/18 MySQL
Python中OpenCV实现简单车牌字符切割
2021/06/11 Python