PHP+MYSQL記事管理システム(2)_PHPチュートリアル

WBOY
リリース: 2016-07-21 16:06:49
オリジナル
1178 人が閲覧しました

###############index.php######################
require"./inc/func.php";
mscon();
require "./inc/header.inc";
?>




  
    



<表幅="100%" ボーダー="0" セルスペース="0" セルパディング="0">





      

          
          
          
          
          
        

      








 








<名前="タイプ" を選択>

$typ=file("list.txt");
$num=カウント($typ);
for($i=2;$i{
echo"";}
?>

<名前=「誰」を選択>









$type=トリム($type);
if($comm)
{
$sec="and comm=1";
$fir="where comm=1";
}
if(!empty($type))
$query="select count(*) from $table where type='$type' $sec";
else
$query="$table $fir からカウント(*) を選択";
$res=mysql_db_query("$database",$query);
if(@mysql_num_rows($res)>0)
$tot=mysql_fetch_array($res);
$total=$tot[0];
$total_page=ceil($total/$pagenum);
echo "";
echo "";
if(empty($page))
$page=0;
if(空($offset))
$offset=0;
$offset=$pagenum*$page;
if(!empty($type))
$query="select * from $table where type='$type' $sec order by id desc limit $offset,$pagenum";
else
$query="select * from $table $fir order by id desc limit $offset,$pagenum";
$res=mysql_db_query("$database",$query);
if(@mysql_num_rows($res)>0)
while($topic=mysql_fetch_array($res))
{
if(strlen($topic[title])>40)
{
$topic[タイトル] =substr($topic[タイトル],0,40) ;
$topic[タイトル]=$topic[タイトル]."....";
}
if(trim($topic[時刻])==date(年月日))
$topic[時刻]="$topic[時刻] echo" gt;

";
}
else
echo "この列には記事がありません!!!";



共:".$total."篇".$total_page."页
[$topic[type]]$topic[title]< ;font size=1>($topic[time])";
if($topic[comm]==1)
echo "精品文章";
if($topic[locked]==1)
echo "文章已锁定";
echo "
阅读:$topic[hits] 次;评论:$topic[p_num]次





$pre=$page-1; 1;
if($page>0)
echo "前のページ

";
echo "前のページ

"; >
echo " 次のページ

";
else echo "次のページ

" ;

に移動:
?type= target="_balnk">


## ################read_article.php################# ########
require"./inc/func.php";
if(!$id)
echo"<script>window.close();</script&gt ;" <br>} <br>mscon (); <br>$query="select * from $table where id='$id'"; <br> if(!$res) <br> { <br> echo "記事が削除されたか、この記事はありません!!"; <br> exit(); <br> } <br>$data=mysql_fetch_array($res); <br>add_hits($data[id]) echo " $data[title]--[$data] [タイプ]]";?> <br></TITLE> <br><META http-equiv=Content-Type content="text/html"> <br> <style type=text/css> <br> <!-- <br>body,table,td,input,textarea { font-family: "宋体"; font-size: 9pt} <br>select { font-family: "宋体" ; <br>code {フォントファミリー: "Courier" ; フォントサイズ: 10pt} <br>a { color: #005500} <br>a:hover { color: #CC0000} <br>.border {border: 1px #000000 solid; background-color:transparent; list-style-position: inside; list-style-type: square} <br>--> <br></style> <br><script language="javascript"> <br>function name() <br>{ <br>  var theResult = true; <br>  var elem4 = null; <br><br>  if (document.forms[0].elements[0].value == "" || document.forms[0].elements[0].value == "undefined" || document.forms[0].elements[0].value == "null") <br>  { <br>    elem4 = prompt("请输入您的姓名:",""); <br>    theResult = false; <br>    document.forms[0].elements[0].value = elem4; <br>  } <br>  return theResult; <br>} <br>function mail() <br>{ <br>  var theResult = true; <br>  var elem1 = null <br>  if ((document.forms[0].elements[1].value.indexOf('@') == -1 || document.forms[0].elements[1].value == "" || document.forms[0].elements[1].value.indexOf('.') == -1)) <br>  { <br>    elem1 = prompt("请输入您的正确的电子邮件地址。谢谢!!",""); <br>    theResult = false; <br>    document.forms[0].elements[1].value = elem1; <br>  } <br>  return theResult; <br>} <br>function go() <br>{ <br>var theResult=true; <br>theResult = name()&&mail(); <br>return theResult; <br>} <br></script>


cellPadding=0 align=center borderColorLight=#000000 border=1 width=545>
  
  
    
  
    
    
    
  
  

      
        
        
          
          
          
 
            
              
              
                

                  

                    
                    

                

            
          

      
        
        
          
          
          
          
          
          
        
        
      

            
          

            
          
height=16 src="images/mail.gif" width=16> href="commend.php?id=">推荐给朋友 发表时间:
            
            阅读次数:
            
          
 

    

if($data[locked]<>0)
{
  echo "对不起!本文已经被管理员锁定!";
}
else
  if($data[html]==1)
     highlight_string($data[cont]);
  else
     echo nl2br($data[cont]);
?>
      

cellpadding=0 align=center bordercolorlight=#000000 border=1 width=545>
  

    















 

www.bkjia.comtru​​ehttp://www.bkjia.com/PHPjc/315322.html技術記事 #############index.php###################### ?session_start(); require./inc/func.php; mscon(); ./inc/header.inc が必要です。 ? script language=javascript function opwin(filename) {win...
ソース:php.cn
このウェブサイトの声明
この記事の内容はネチズンが自主的に寄稿したものであり、著作権は原著者に帰属します。このサイトは、それに相当する法的責任を負いません。盗作または侵害の疑いのあるコンテンツを見つけた場合は、admin@php.cn までご連絡ください。
最新の問題
人気のチュートリアル
詳細>
最新のダウンロード
詳細>
ウェブエフェクト
公式サイト
サイト素材
フロントエンドテンプレート
私たちについて 免責事項 Sitemap
PHP中国語ウェブサイト:福祉オンライン PHP トレーニング,PHP 学習者の迅速な成長を支援します!

      
发表评论



您的姓名:

您的電子邮件:

仅站长可见:



発行表评论:










相关评论


  $query="select * from $ping_tab where p_id='$id' order by time desc";
$res=mysql_db_query("$database",$query);
if(mysql_num_rows($res)>0)
{$i=1;
while($ping=mysql_fetch_array($res))
echo "评论人:$ping[name] 电子邮件:$ping[mail]
".nl2br($ping[p_cont])."n" ;
}
else
echo "暂時没本文的相关评论!";
?>