Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
06-03-2014, 08:43 AM #1
- Join Date
- May 2014
- Thanked 0 Times in 0 Posts
Marking private messages for delete in Php
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.
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>';
// close 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.
06-03-2014, 11:30 AM #2
- Join Date
- Jun 2005
- Blackpool. UK
- Thanked 4 Times in 4 Posts
And the HTML code helps diagnose the problem .... How exactly???
Indifference will be the downfall of mankind, but who cares?
06-03-2014, 11:30 AM #3
- Join Date
- Mar 2007
- Thanked 2,224 Times in 2,211 Posts
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)