文章推荐系统(二)


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 相关文章推荐
用session做客户验证时的注意事项
Oct 09 PHP
php数据结构与算法(PHP描述) 查找与二分法查找
Jun 21 PHP
使用php 获取时间今天明天昨天时间戳的详解
Jun 20 PHP
采用memcache在web集群中实现session的同步会话
Jul 05 PHP
php的mssql数据库连接类实例
Nov 28 PHP
php实现的简单日志写入函数
Mar 31 PHP
php文件下载处理方法分析
Apr 22 PHP
利用php抓取蜘蛛爬虫痕迹的示例代码
Sep 30 PHP
PHP检查端口是否可以被绑定的方法示例
Aug 09 PHP
php反射学习之不用new方法实例化类操作示例
Jun 14 PHP
在laravel框架中实现封装公共方法全局调用
Oct 14 PHP
php 中self,this的区别和操作方法实例分析
Nov 04 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
别人整理的服务器变量:$_SERVER
2006/10/20 PHP
利用PHP制作简单的内容采集器的原理分析
2008/10/01 PHP
PHP对称加密算法(DES/AES)类的实现代码
2017/11/14 PHP
详解PHP队列的实现
2019/03/14 PHP
PHP从零开始打造自己的MVC框架之类的自动加载实现方法详解
2019/06/03 PHP
innertext , insertadjacentelement , insertadjacenthtml , insertadjacenttext 等区别
2007/06/29 Javascript
JS的递增/递减运算符和带操作的赋值运算符的等价式
2007/12/08 Javascript
Javascript高级技巧分享
2014/02/25 Javascript
AngularJS基础学习笔记之控制器
2015/05/10 Javascript
jquery正则表达式验证(手机号、身份证号、中文名称)
2015/12/31 Javascript
require.js配合插件text.js实现最简单的单页应用程序
2016/07/12 Javascript
JS基于面向对象实现的选项卡效果示例
2016/12/20 Javascript
基于layer.js实现收货地址弹框选择然后返回相应的地址信息
2017/05/26 Javascript
JavaScript累加、迭代、穷举、递归等常用算法实例小结
2018/05/08 Javascript
nodejs中实现修改用户路由功能
2019/05/24 NodeJs
微信小程序实现点击效果
2019/06/21 Javascript
javascript实现blob加密视频源地址的方法
2019/08/08 Javascript
Python中几种操作字符串的方法的介绍
2015/04/09 Python
Python操作Access数据库基本步骤分析
2016/09/19 Python
关于Tensorflow中的tf.train.batch函数的使用
2018/04/24 Python
python实现反转部分单向链表
2018/09/27 Python
基于python历史天气采集的分析
2019/02/14 Python
python实现文件的备份流程详解
2019/06/18 Python
python实现TCP文件传输
2020/03/20 Python
PyCharm 2020.2.2 x64 下载并安装的详细教程
2020/10/15 Python
Django web自定义通用权限控制实现方法
2020/11/24 Python
Perfume’s Club中文官网:西班牙美妆在线零售品牌
2020/08/24 全球购物
在子网210.27.48.21/30种有多少个可用地址?分别是什么?
2014/07/27 面试题
中专三年学习的个人自我评价
2013/12/12 职场文书
应届行政管理专业个人自我评价
2013/12/28 职场文书
黄河的主人教学反思
2014/02/07 职场文书
2015年市场部工作总结
2015/04/30 职场文书
审查起诉阶段律师意见书
2015/05/19 职场文书
消防宣传标语大全
2015/08/03 职场文书
教师个人教学反思
2016/02/23 职场文书
React中的Context应用场景分析
2021/06/11 Javascript