人人人妻人人人妻人人人,99精品国产综合久久久久五月天 ,欧美白人最猛性XXXXX,日韩AV无码免费播放

News新聞

業(yè)界新聞動態(tài)、技術(shù)前沿
Who are we?

您的位置:首頁      樂道系統(tǒng)FAQ      php實現(xiàn)評論回復刪除功能

php實現(xiàn)評論回復刪除功能

標簽: 發(fā)布日期:2017-05-23 00:00:00 306
【CLI】利用Curl下載文件實時進度條顯示的實現(xiàn)

簡單的評論回復刪除功能,具體內(nèi)容如下

一、數(shù)據(jù)庫

建立兩張表,一是pinglun表;二是huifu表

 效果如下:

代碼如下:

1.主頁面 main.php

<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>無標題文檔</title>
 
 
 
<h1>朋友圈</h1>
<div>內(nèi)容:</div>
<div>今天很嗨</div>
<div><img src="../picture/timg.jpg" width="300" height="200"></div><br>
<form action="mainchuli.php" method="post">
 
<input type="text" hidden="hidden" value="zhangsan" name="zhangsan"> <!--因為沒有權(quán)限,這里給了一個默認值-->
 
<textarea name="content"></textarea><input type="submit" value="評論"><!--評論顯示的地方--><!--單擊評論提交內(nèi)容進處理頁面-->
</form>
 
 
<!--?php
  require"DBDA.class.php"; //調(diào)用封裝類注意修改數(shù)據(jù)庫名
  $db = new DBDA();
  $sql ="select * from Pinglun";
  $arr = $db--->query($sql,1);
  foreach($arr as $v)
  {
    echo"
       <div style="color:blue">{$v[1]} {$v[3]}</div>
       <div style="color:blue">{$v[2]}</div>
       <form action="delchuli.php?id={$v[0]}" method="post"> //刪除按鈕
        <input type="submit" value="刪除">
       </form>
       <form action="huifuchuli.php?id={$v[0]}" method="post"> //回復按鈕
        <textarea name="Comment"></textarea><input type="submit" value="回復">
       </form>
       ";
       
      $dc = new DBDA(); 
      $sql1 ="select * from huifu where jieshouid ={$v[0]}"; //查詢回復表中的id和傳過去的id是不是一樣的
          $arr1 = $dc->query($sql1,1);
      foreach($arr1 as $k)
      {
        echo "<div>{$k[2]} {$k[3]}</div>
           <div>{$k[4]}</div>
           ";
      }
         
  }
     
?>