検索
ホームページphp教程php手册PHP MYSQL 記事管理システム (2)

PHP MYSQL 記事管理システム (2)

Jun 13, 2016 pm 12:42 PM
php+mysql記事マネジメントシステム

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




  
    



      

          
          
          
          
          
        

      
PHP MYSQL 記事管理システム (2)











 











$typ=file("list.txt");
$num=count($typ);
for($i=2;$i{
echo"



$type=trim($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 から count(*) を選択";
$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(empty($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[title]=substr($topic[title],0,40) ;
$topic[タイトル]=$topic[タイトル]."....";
}
if(trim($topic[time])==date(Y年m月d日))
$topic[time]="$topic[時間]";
echo"

";
}
else
echo "申し訳ありませんが、この列にはまだ記事がありません!!!";
echo "
共:".$total."篇".$total_page."页
[$topic[type]]$topic[title]> ;($topic[time])";
if($topic[comm]==1)
echo "精品文章";
if($topic[locked]==1)
echo "文章已锁定";
echo "
阅读:$topic[hits] 次;评论:$topic[p_num]次
";






< ;td>
ジャンプ先:


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

";
else
echo "前のページ

";
echo "

";
else echo " 次のページ

";?>

列を選択:
;?> ?type=' document.forms[2].elements[0].value;" >
$typ=file ("list.txt");
$num=count($typ);
for($i=0;$i{
echo "$typ[$i] ;}
?>
echo $PHP_SELF;?>?type=
inc/footer.inc";?>
###################read_article.php############### ########### #

require"./inc/func.php";
if(!$id)
{
echo" <script>window.close();&lt ;/script>"; <br> exit(); <br>} <br>mscon(); <br>$query="select * from $table where id= '$id'"; <br>$res =mysql_db_query("$database",$query); <br>if(!$res) <br> { <br> echo "この記事は削除されているか、この記事はありません!!"; <br> exit(); <br> } <br>$data=mysql_fetch_array($res); <br>add_hits($data[id]); <br>$pre=$data[id] -1; <br>$next=$data; <br><HTML> <br><br>< "$data[タイトル]--[$data [タイプ]]";?> <br> <br><META http-equiv=Content-Type content="text/html; charset= gb2312"> <br><style type =text/css> <br><!-- <br>body,table,td,input,textarea { font-family: "宋体"; font-size: 9pt } <br>select { font-family: "宋体"; font-size: 9pt} <br>code {font-family: "Courier" ; font-size: 10pt} <br>a { color: #005500} <br>a:ホバー { color: #CC0000} <br>.border {border: 1px #000000 solid; background-color:transparent; list-style-position: inside; list-style-type: square} <br>--> <br> <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>
  
  
    
  
    
    
    
  
  

      
        
        
          
          
          
 
            
              
              
                

                  

                     echo $data[title];?>
                    

                

            
          

      
        
        
          
          
          
          
          
          
        
        
      

            
          

            
          
PHP MYSQL 記事管理システム (2)            height=16 width=16>             href="commend.php?id= echo "$data[id]&title=$data[title]";?>">推荐给朋友 发表时间:
             echo $data[time];?>
            阅读次数:
             echo $data[hits];?>
          
 

    


if($data[locked]0)
{
  echo "PHP MYSQL 記事管理システム (2)对不起!本文已经被管理员锁定!";
}
else
  if($data[html]==1)
     highlight_string($data[cont]);
  else
     echo nl2br($data[cont]);
?>
      

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

    





🎜>
;





      
发表评论




> " name="Submit2" value="Rewrite" class="border">
gt;


$query="select * from $ping_tab where p_id='$id' order by time desc";クエリ);
if(mysql_num_rows($res)>0)
{$i=1;
while($ping=mysql_fetch_array($res))
echo " コメント者: $ping[名前] 電子メール: $ping[mail]
".nl2br($ping[p_cont])."
時刻: $ping[time] 差出人: $ping[ip]
n" ;
}
else
echo "現在、この記事に関連するコメントはありません!";
?>

href="javascript:window.close()" >ウィンドウを閉じる

inc/フッター.inc";?>
声明
この記事の内容はネチズンが自主的に寄稿したものであり、著作権は原著者に帰属します。このサイトは、それに相当する法的責任を負いません。盗作または侵害の疑いのあるコンテンツを見つけた場合は、admin@php.cn までご連絡ください。

ホットAIツール

Undresser.AI Undress

Undresser.AI Undress

リアルなヌード写真を作成する AI 搭載アプリ

AI Clothes Remover

AI Clothes Remover

写真から衣服を削除するオンライン AI ツール。

Undress AI Tool

Undress AI Tool

脱衣画像を無料で

Clothoff.io

Clothoff.io

AI衣類リムーバー

AI Hentai Generator

AI Hentai Generator

AIヘンタイを無料で生成します。

ホットツール

ドリームウィーバー CS6

ドリームウィーバー CS6

ビジュアル Web 開発ツール

SecLists

SecLists

SecLists は、セキュリティ テスターの究極の相棒です。これは、セキュリティ評価中に頻繁に使用されるさまざまな種類のリストを 1 か所にまとめたものです。 SecLists は、セキュリティ テスターが必要とする可能性のあるすべてのリストを便利に提供することで、セキュリティ テストをより効率的かつ生産的にするのに役立ちます。リストの種類には、ユーザー名、パスワード、URL、ファジング ペイロード、機密データ パターン、Web シェルなどが含まれます。テスターはこのリポジトリを新しいテスト マシンにプルするだけで、必要なあらゆる種類のリストにアクセスできるようになります。

PhpStorm Mac バージョン

PhpStorm Mac バージョン

最新(2018.2.1)のプロフェッショナル向けPHP統合開発ツール

ZendStudio 13.5.1 Mac

ZendStudio 13.5.1 Mac

強力な PHP 統合開発環境

SublimeText3 Linux 新バージョン

SublimeText3 Linux 新バージョン

SublimeText3 Linux 最新バージョン