0

我目前有一个 php 消息传递系统设置,可以发送消息并且一切正常。消息删除,但只有在手动更新数据库中的变量并将其设置为 1 时才会删除。所以现在我只需要一种方法让用户通过 php.ini 为自己删除消息。

目前,我在每条消息的侧面都有文字“删除”。我想让这个可点击,以便在点击时将数据库中的变量值设置为 0 到 1。

代码:

<?php
    $page_title = "Messages";
        include('includes/header.php'); 
        confirm_logged_in();
        include ('includes/mod_login/login_form.php');  
    ?>

<div class="modtitle">
  <div class="modtitle-text">Inbox</div>
</div>

<div class="modcontent">

<strong>Inbox</strong> | <a href="messages_sent.php">Sent Messages</a> | <a href="messages_deleted.php">Deleted</a>
<br /><br />
<table width="100%" border="0" cellpadding="5" cellspacing="0">
  <tr bgcolor="#CCCCCC">
    <td width="30%"><strong>Recieved</strong></td>
    <td width="20%"><strong>From</strong></td>
    <td width="28%"><strong>Subject</strong></td>
    <td width="0%"><strong>Read/Unread</strong></td>
      <td width="0%"><strong>Delete</strong></td>
  </tr>
<?php
        $inbox_set = get_inbox();
        while ($inbox = mysql_fetch_array($inbox_set)) {

?>

<?php
 if ($inbox['read'] == 0) { ?>
  <tr bgcolor="#6666B3">
<?php }
 if ($inbox['read'] == 1) { ?>
    <tr>

<?php }  ?>



    <td><?php 



    $datesent1 = $inbox['date_sent'];


    echo "$datesent1"; ?></td>


    <a href="profile.php?id={$inbox['from_user_id']}"><td><?php echo "<a href=\"profile.php?id={$inbox['from_user_id']}\">{$inbox['display_name']}"; ?></td></a>

    <td><?php echo "<strong><a href=\"read_message.php?msg={$inbox[0]}\">{$inbox['subject']}</a></strong>"; ?></td>

    <td><?php   if ($inbox['read'] == 0)  {
                echo "Unread"; 
                }
                if ($inbox['read'] == 1)  {
                echo "Read";
                }
                ?></td>
                <td>
                <?php 
                if ($inbox['delete'] == 0)  {
                echo "Delete";


                }
                 if ($inbox['delete'] == 1)  {
                echo "$deleted_set;";
                }   


                    ; ?></td>



                </td>

<?php
}


?>

</tr>
</table>

</div>

<?php include('includes/footer.php'); ?>
4

0 回答 0