单击另一个链接-PHP时,永久禁用特定链接

时间:2014-12-30 17:40:18

标签: php

 $newcomments= mysql_query("SELECT * FROM comments,items WHERE comments.ino=items.ino AND comments.ino='$ino' AND uid='$uname'") or die ("cant get new comments");
      $row3=mysql_fetch_array($newcomments);
      $new_com_no=$row3['com_no'];

 echo" <form name='postform' class='form-horizontal' role='form' method='post' action='member.php?uname=$uname&ino=$ino&cid=$cid&commit=$commit&role=$role&title=$title&op_type=PostComment' align='right'>
      <h4 align='center'><font face='Trebuchet MS'>Comment Details</font></h4>
      <table class='table table-hover borderless' style='width:600px;' align='center'>
      <tr>
        <th align='left'>Comment</th>
        <th align='left'>Actions</th>
      </tr>";

  while ($row=mysql_fetch_array($comments))
  {
     $comment=$row['comment'];
     $com_no=$row['com_no'];
     $uid=$row['uid'];
     $decision=$row['decision'];
 $ino=$row2['ino'];
     $cid=$row2['cid'];
     $title=$row2['title'];

     echo "<tr><td> ";
     echo $comment;
     echo"</td><td>";

当用户点击发表评论&#39;在评论前面链接,相应的评论存储在数据库表中 在此处,它检查注释编号是否已存在于数据库表中。 我的问题是,当我点击发表评论&#39;链接,禁用所有编辑链接。 我想要的是只禁用特定的编辑&#39;链接,评论在数据库中。

     if($com_no=$new_com_no)
   {
        $com_no=$row['com_no'];
        echo"<a class='btn btn-small btn-info'  disabled>Edit</a>";
    }
   else{
      $com_no=$row['com_no'];
     echo"<a href='member.php?uname=$uname&ino=$ino&cid=$cid&com_no=$com_no&comment=$comment&op_type=EditComment' class='btn btn-small btn-info'>Edit</a>";
   }


     $com_no=$row['com_no'];

     echo"</td>
     <td><a href='member.php?uname=$uname&com_no=$com_no&ino=$ino&cid=$cid&title=$title&comment=$comment&op_type=PostComment' class='btn btn-small btn-warning'>Post Comment</a>   
     </td></tr>";

   }

    echo"<tr><td>";

    echo"<font face='Exo' color='#808080'>Please Click 'Post Comment' to Submit Your Comments</font>";

   echo"<a class='btn btn-success btn-small' href='member.php?uname=$uname&com_no=$com_no&ino=$ino&cid=$cid&title=$title&op_type=GetApproval'>Approval</a>

   <a class='btn btn-primary btn-small' href='member.php?uname=$uname&com_no=$com_no&ino=$ino&cid=$cid&title=$title&op_type=GetComment'>Comment</a>

   <input class='btn btn-default btn-small' type='button' value='Cancel' onClick='history.back()'>
   </td></tr>";

echo"</table></form>";

0 个答案:

没有答案