文章推荐系统(二)


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 相关文章推荐
Discuz板块横排显示图片的实现方法
May 28 PHP
php ss7.5的数据调用 (笔记)
Mar 08 PHP
php获取用户IPv4或IPv6地址的代码
Nov 15 PHP
php中使用preg_replace函数匹配图片并加上链接的方法
Feb 06 PHP
深入理解PHP之源码目录结构与功能说明
Jun 01 PHP
CI框架实现优化文件上传及多文件上传的方法
Jan 04 PHP
详解php用curl调用接口方法,get和post两种方式
Jan 13 PHP
PHP使用SWOOLE扩展实现定时同步 MySQL 数据
Apr 09 PHP
laravel 5.4中实现无限级分类的方法示例
Jul 27 PHP
laravel框架中视图的基本使用方法分析
Nov 23 PHP
ThinkPHP类似AOP思想的参数验证的实现方法
Dec 18 PHP
eval(cmd)与eval($cmd)的区别与联系
Jul 07 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
PHILIPS AE3805收音机的分析打磨
2021/03/02 无线电
PHP 输出简单动态WAP页面
2009/06/09 PHP
PHP 基于Yii框架中使用smarty模板的方法详解
2013/06/13 PHP
Laravel 5 框架入门(二)构建 Pages 的管理功能
2015/04/09 PHP
JavaScript Event学习补遗 addEventSimple
2010/02/11 Javascript
jQuery1.6 使用方法一
2011/11/23 Javascript
Javascript无阻塞加载具体方式
2013/06/28 Javascript
js模拟点击以提交表单为例兼容主流浏览器
2013/11/29 Javascript
JavaScript学习笔记之基础语法
2015/01/22 Javascript
jQuery插件学习教程之SlidesJs轮播+Validation验证
2016/07/12 Javascript
JS动态加载脚本并执行回调操作
2016/08/24 Javascript
BootstrapValidator实现注册校验和登录错误提示效果
2017/03/10 Javascript
JavaScript数据结构之二叉树的查找算法示例
2017/04/13 Javascript
vue中路由参数传递可能会遇到的坑
2017/12/07 Javascript
详解vue填坑之解决部分浏览器不支持pushState方法
2018/07/12 Javascript
[04:11]DOTA2亚洲邀请赛小组赛第一日 TOP10精彩集锦
2015/01/30 DOTA
Swift 3.0在集合类数据结构上的一些新变化总结
2016/07/11 Python
python实现数据写入excel表格
2018/03/25 Python
pandas 选择某几列的方法
2018/07/03 Python
python+rsync精确同步指定格式文件
2019/08/29 Python
Python TCPServer 多线程多客户端通信的实现
2019/12/31 Python
利用setuptools打包python程序的方法步骤
2020/01/18 Python
Pycharm制作搞怪弹窗的实现代码
2021/02/19 Python
HTML如何让IMG自动适应DIV容器大小的实现方法
2020/02/25 HTML / CSS
英国比较机场停车场网站:Airport Parking Essentials
2019/12/01 全球购物
英国知名小木屋定制网站:Tiger Sheds
2020/03/06 全球购物
敏捷开发的主要原则都有哪些
2015/04/26 面试题
个人自荐信
2013/12/05 职场文书
学习党章思想汇报
2014/01/07 职场文书
银行行长竞聘演讲稿
2014/04/23 职场文书
幼儿园大班开学寄语
2014/08/02 职场文书
作风年建设汇报材料
2014/08/14 职场文书
雨雪天气温馨提示
2015/07/15 职场文书
学习社交礼仪心得体会
2016/01/22 职场文书
《分数的意义》教学反思
2016/02/20 职场文书
MySQL8.0.18配置多主一从
2021/06/21 MySQL