首頁  >  文章  >  後端開發  >  文章推薦系統(二)_PHP教學

文章推薦系統(二)_PHP教學

WBOY
WBOY原創
2016-07-21 16:06:361162瀏覽

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

";
  echo "";
  echo"";
  echo"";
  echo"
";
  echo"你是不是在灌水呀?提交的文章";
  echo"
";
  echo"的長度必須大於50個漢字。你重新提交文章。謝謝";
  echo"
";
  echo"【重新提交文章】   ";
  echo"【返回主頁】";
  echo"
";
  echo"";
  echo"";
  ";
  echo"";
  echo"";
=mailto:webinfro@163.com>聯絡站長 
          |";
  echo"";
";
  echo"";
>  echo"
|      回首頁       | 說明 
          |
    ";
  echo"
  閱讀文章    
          |
"; >
  exit;
}
$strlen=strlen($name);
if($strlen  echo"" ;
  echo"";
  echo "";
  echo"
";
  echo"請你正確輸入你的名字";
  echo"
";
  echo"【重新提交文章】    ";
  echo"【返回首頁】";
  echo"
";
  echo"";
  echo"";
  echo""; =20%>   搜尋文章  
         |      a>    
          |";
  echo"";
  echo"
|     /td>";
  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)){
  . 100%>";
    echo" ";
    echo"你所推薦的文章已經存在了";
   echo" ";
    echo"重新推薦下一篇文章";
    echo" ";
    echo"";
    echo"如果你確信本站沒有你所推薦的文章,請你點這裡同時Bamboo聯絡";
    echo"
";
    echo" ";
  =appre.htm>重新發表新的文章】";
    echo"【回首頁】";
    echo"";
    echo"";
    mysql_close($conn);
    echo"    echo"";
    echo"";
    echo"";

           | td>";
    echo"";
    echo"
|      發頁  td width=20%> |  建議說明 
          |
文章  
          |      
  聯絡站長 
         
";

    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" 20%>   搜尋文章  
          |          
          |";
  echo"";
  echo"
|      返回首頁      返回首頁  td>";
  echo"
 |  建議說明 
          |
          echo"
";

  exit;
  }
}


e $webwebadd1;
$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"
";   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"
 |  建議說明 
建議說明 
建議說明 
|
   搜尋文章  
          20%>  閱讀文章    
          |
>聯繫站長 
          |
";

  echo"";

http://www.bkjia.com/PHPjc/315387.htmlwww.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