文章推荐系统(二)


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 相关文章推荐
让你同时上传 1000 个文件 (一)
Oct 09 PHP
PHP 编程请选择正确的文本编辑软件
Dec 21 PHP
Mysql和网页显示乱码解决方法集锦
Mar 27 PHP
php 异常处理实现代码
Mar 10 PHP
php at(@)符号的用法简介
Jul 11 PHP
解析MySql与Java的时间类型
Jun 22 PHP
PHP中绘制图像的一些函数总结
Nov 19 PHP
PHP表单数据写入MySQL数据库的代码
May 31 PHP
PHP+原生态ajax实现的省市联动功能详解
Aug 15 PHP
PHP字符串与数组处理函数用法小结
Jan 07 PHP
php微信小程序解包过程实例详解
Mar 31 PHP
php 文件上传至OSS及删除远程阿里云OSS文件
Jul 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
session 加入redis的实现代码
2016/07/15 PHP
深入浅出讲解:php的socket通信原理
2016/12/03 PHP
php实现的三个常用加密解密功能函数示例
2017/11/06 PHP
php 截取中英文混合字符串的方法
2018/05/31 PHP
php实现根据身份证获取精准年龄
2020/02/26 PHP
雄兵连第三季海报曝光,艾妮熙德成主角,蔷薇新造型
2021/03/09 国漫
jquery validation插件表单验证的一个例子
2010/03/03 Javascript
电子商务网站上的常用的js放大镜效果
2011/12/08 Javascript
document.documentElement的一些使用技巧
2013/04/18 Javascript
js中Image对象以及对其预加载处理示例
2013/11/20 Javascript
最简单的JavaScript验证整数、小数、实数、有效位小数正则表达式
2015/04/17 Javascript
CSS中position属性之fixed实现div居中
2015/12/14 Javascript
谈谈我对JavaScript中typeof和instanceof的深入理解
2015/12/25 Javascript
jQuery基于xml格式数据实现模糊查询及分页功能的方法
2016/12/25 Javascript
详解微信小程序开发之城市选择器 城市切换
2017/01/17 Javascript
jQuery实现可拖动进度条实例代码
2017/06/21 jQuery
使用javaScript实现鼠标拖拽事件
2020/04/03 Javascript
浅谈对于react-thunk中间件的简单理解
2019/05/01 Javascript
vue中el-input绑定键盘按键(按键修饰符)
2020/07/22 Javascript
Js数组扁平化实现方法代码总汇
2020/11/11 Javascript
videocapture库制作python视频高速传输程序
2013/12/23 Python
python3实现抓取网页资源的 N 种方法
2017/05/02 Python
详细分析python3的reduce函数
2017/12/05 Python
在python中安装basemap的教程
2018/09/20 Python
Pyqt QImage 与 np array 转换方法
2019/06/27 Python
python版百度语音识别功能
2019/07/09 Python
Python requests及aiohttp速度对比代码实例
2020/07/16 Python
基于PyInstaller各参数的含义说明
2021/03/04 Python
UNDONE手表官网:世界领先的定制手表品牌
2018/11/13 全球购物
优秀教师工作感言
2014/02/16 职场文书
教堂婚礼主持词
2014/03/14 职场文书
毕业寄语大全
2014/04/09 职场文书
2015年社区卫生工作总结
2015/04/21 职场文书
机关单位2016年创先争优活动总结
2016/04/05 职场文书
Python获取江苏疫情实时数据及爬虫分析
2021/08/02 Python
Java中Dijkstra(迪杰斯特拉)算法
2022/05/20 Java/Android