>백엔드 개발 >PHP 튜토리얼 >文章推荐系统(二)_PHP教程

文章推荐系统(二)_PHP教程

WBOY
WBOY원래의
2016-07-21 16:06:361183검색

======APPRE.PHP==========
$strlen=strlen($articlemsg);
if($strlen  echo "

";
  echo "";
  echo"";
  echo"";
  echo"
";
  echo"你是不是在灌水呀?为防止部分网友善意的灌水,本站规定你所提交的文章";
  echo"
";
  echo"的长度必须大于50个汉字。请你重新提交文章。谢谢";
  echo"
";
  echo"【重新提交文章】   ";
  echo"【返回到主页】";
  echo"
";
  echo"";
  echo"";
  echo"";
  echo"";
  echo"";
  echo"";
  echo"";
  echo"";
  echo"
|      返回首页       |  推荐说明 
          |
   搜索文章  
          |      
  阅读文章    
          |
  联系站长 
          |
";

  exit;
}
$strlen=strlen($name);
if($strlen  echo"";
  echo"";
  echo"";
  echo"
";
  echo"请你正确输入你的名字";
  echo"
";
  echo"【重新提交文章】    ";
  echo"【返回主页】";
  echo"
";
  echo"";
  echo"";
  echo"";
  echo"";
  echo"";
  echo"";
  echo"";
  echo"";
  echo"
|      返回首页       |  推荐说明 
          |
   搜索文章  
          |      
  阅读文章    
          |
  联系站长 
          |
";

  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"";
    echo"";
    echo"";
    echo"";
    echo"";
    echo"
";
    echo"你所推荐的文章已经存在了";
    echo"
";
    echo"重新推荐下一篇文章";
    echo"
";
    echo"如果你确信本站没有你所推荐的文章,请你点这里与此同时Bamboo联系";
    echo"
";
    echo"【重新发表新的文章】";
    echo"【返回主页】";
    echo"
";
    mysql_close($conn);
    echo"";
    echo"";
    echo"";
    echo"";
    echo"";

    echo"";
    echo"";
    echo"";
    echo"
|      返回首页       |  推荐说明 
          |
   搜索文章  
          |      
  阅读文章    
          |
  联系站长 
          |
";

    exit;}
    }
$sql="select *from article where name=$name";
$result=mysql_query($sql,$conn);
if($result){
  if(mysql_fetch_object($result)){
  echo"";
  echo"";
  echo"";
  echo"";
  echo"
";
  echo"本站数据库记录显示已经有一个和你同名的记录,请你换一个名字重新发表文章";
  echo"
";
  echo"重新发表文章";
  echo"返回主页";
  echo"
";
  mysql_close($conn);
  echo"";
  echo"";
  echo"";
  echo"";
  echo"";
  echo"";
  echo"";
  echo"";
  echo"
|      返回首页       |  推荐说明 
          |
   搜索文章  
          |      
  阅读文章    
          |
  联系站长 
          |
";

  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()."
";
if(mysql_query($sql,$conn)){
  echo"";
  echo"";
  echo"";
  echo"
";
  echo"谢谢你,斑竹园的发展离不开你的支持。你提交的文章已经接受";
  echo"
";
  echo"【提交另一篇文章】";
  echo"【返回主页】";
  echo"
";
  mysql_close($conn);
  }
else{
  echo"";
  echo"";
  echo"";
  echo"
";
  echo"对不起,你提交的文章出现错误,请你重新提交";
  echo"
";
  echo"【重新提交】";
  echo"【返回主页】";
  echo"
";
  mysql_close($conn);
  }
  echo"";
  echo"";
  echo"";
  echo"";
  echo" ";
  echo"";
  echo"";
  echo"";
  echo"
|      返回首页       |  推荐说明 
          |
   搜索文章  
          |      
  阅读文章    
          |
  联系站长 
          |
";

?>

www.bkjia.comtruehttp://www.bkjia.com/PHPjc/315387.htmlTechArticle======APPRE.PHP========== $strlen=strlen($articlemsg); if($strlen50){ echo table align=center width=100%; echo tr align=centertd; echo你是不是在灌水呀?为防止部分网友善...
성명:
본 글의 내용은 네티즌들의 자발적인 기여로 작성되었으며, 저작권은 원저작자에게 있습니다. 본 사이트는 이에 상응하는 법적 책임을 지지 않습니다. 표절이나 침해가 의심되는 콘텐츠를 발견한 경우 admin@php.cn으로 문의하세요.