Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
  1. #1
    New to the CF scene
    Join Date
    May 2014
    Posts
    4
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Marking private messages for delete in Php

    Hi,

    i think people are not understanding my previous thread. so i am writing this thread to make it more clear.

    I am developing private messaging system in my website, so that users can send and receive private messages. I have developed this system am everything seems to be working fine, except deleting option.
    what i am trying to do is, i want to add checkbox in front of every message. and when user checked the checkbox and click on Delete button, selected message should got deleted from database.

    below code will list messages in Inbox with checkbox in front of every message.

    Code:
    echo "<table border='1' cellpadding='10'>";
    echo '<tr> <th><input type="checkbox" name="selectall"></th><th>From</th> <th>Subject</th> <th>Date</th></tr>';
    // loop through results of database query, displaying them in the table
    while($row = mysqli_fetch_array($selectresult))
    {
    // echo out the contents of each row into a table
    echo '<tr style="'.($row['message_read'] ? 'color:#BDBDBD;' : '').'">';
    echo '<td> <input type="checkbox" name="check_list[]" value="'.$row['id'].'"> </td>';
    echo '<td>' . $row['from_user'] . '</td>';
    echo '<td>' . $row['message_title'] . '</td>';
    echo '<td>' . $row['date'] . '</td>';
    echo '<td><a href="?page_id=1427&MI=' . $row['message_id'] . '">Read</a> </td>';
    echo '<td><a href="?page_id=1329&MI=' . $row['message_id'] . '">Delete</a> </td>';
    echo '<td><a href="?page_id=1312&MI=' . $row['message_id'] . '">Restore</a> </td>';
    echo "</tr>";
    }

    // close table>
    echo "</table>";

    Now i am not able to get message id's in delete page, and delete checked messages.

    Please if someone can give any clue it will be very helpful Thank You.

  • #2
    New Coder
    Join Date
    Jun 2005
    Location
    Blackpool. UK
    Posts
    98
    Thanks
    0
    Thanked 4 Times in 4 Posts
    And the HTML code helps diagnose the problem .... How exactly???
    Chris

    Indifference will be the downfall of mankind, but who cares?

  • #3
    Supreme Master coder! abduraooft's Avatar
    Join Date
    Mar 2007
    Location
    N/A
    Posts
    14,861
    Thanks
    160
    Thanked 2,223 Times in 2,210 Posts
    Blog Entries
    1
    Please post the parsed html output of your page with checkboxes, taken from your browser's "view source" option.
    Are you using POST/GET method in your form?
    The Dream is not what you see in sleep; Dream is the thing which doesn't let you sleep. --(Dr. APJ. Abdul Kalam)


  •  

    Tags for this Thread

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •