contra10 Posted January 22, 2009 Share Posted January 22, 2009 i'm tryin to delete messages sent to an inbox... my code is <?php echo "<tr>"; echo"<td><Input type = 'Checkbox' Name ='checkbox' value ='$msgid'></td>"; echo "<td align='left' width='10%' height='50'>"; echo"<a href ='http://localhost/profile/index.php?user=$friendid' ><img src='http://localhost/image/imagereplace.php?id=$friendid'></a>"; echo "</td>"; if ($bgcc == $colorvalue){ echo"<td width= '90%' align='center' bgcolor='#DEDAD7'><a style='text-decoration:none' href ='http://localhost/inbox/message.php?msg=$msgid' >"; }else{ echo"<td width= '90%' align='center' bgcolor='black'><a style='text-decoration:none' href ='http://localhost/inbox/message.php?msg=$msgid' >"; } echo"<FONT FACE='ariel' SIZE='3' color='#0094f7'><b>$title<br><br></font></td></tr>"; echo "<tr><td></td><td></td>"; echo "<td align='right' bgcolor='#DEDAD7'><FONT FACE='ariel' SIZE='2' color='#0094f7'>Sent by <b>$sendingusername</b> on $date</font></a></td>"; echo "</tr>"; } ?> <input type="submit" name="delete" value="delete"> </table> </form> <?php if (isset($_POST['checkbox']) and ($_POST['delete'])) { $checkboxid = mysql_real_escape_string($_POST['checkbox']); mysql_query("DELETE FROM inbox WHERE iid='$checkboxid'"); } ?> Quote Link to comment Share on other sites More sharing options...
The Little Guy Posted January 22, 2009 Share Posted January 22, 2009 did you spell id correct? In the following you have to i's is that right? "DELETE FROM inbox WHERE iid='$checkboxid'" Quote Link to comment Share on other sites More sharing options...
contra10 Posted January 22, 2009 Author Share Posted January 22, 2009 yep...its supposed to be iid...i jus tried it again it worked Quote Link to comment Share on other sites More sharing options...
contra10 Posted January 22, 2009 Author Share Posted January 22, 2009 when i click delete tho..how do i go back to the same page and show the inbox...cause i have to press the back button in internet explorer ...should i do header Quote Link to comment Share on other sites More sharing options...
The Little Guy Posted January 22, 2009 Share Posted January 22, 2009 So... Topic Solved? Quote Link to comment Share on other sites More sharing options...
contra10 Posted January 22, 2009 Author Share Posted January 22, 2009 yep Quote Link to comment Share on other sites More sharing options...
contra10 Posted January 22, 2009 Author Share Posted January 22, 2009 one last question from it...how can i delete it but still display the other messages? Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.