zhahaman2001 Posted January 18, 2007 Share Posted January 18, 2007 well i have a mailing system on my website and i want it so my users while in their inbox can check each message they want deleted and click a delete button to delete it here was m idea of how to do this (this isnt all my code but this is just to give you an idea of how i was trying to do it)(id is a number)//[INBOX]$temp = mysql_query("select * from messages where owner='$user'");while ($mail = mysql_fetch_array($temp)) { print "Delete<input type='checkbox' name='$mail[id]'>";}//[DELETE MESSAGES]$temp = mysql_query("select * from messages where owner='$user'");while ($mail = mysql_fetch_array($temp)) { if(${mail[id]} == "on"){ mysql_query("delete from messages where id='$mail[id]' }}but ${mail[id]} dosnt hold anything can someone tell me what im doing wrong and how to fix it thanks... Quote Link to comment https://forums.phpfreaks.com/topic/34686-checkbox-mail-delete-system-not-working-out/ Share on other sites More sharing options...
Jessica Posted January 18, 2007 Share Posted January 18, 2007 Change to if($_POST[$mail[id]] == "on")Your {} are a little wierd. Quote Link to comment https://forums.phpfreaks.com/topic/34686-checkbox-mail-delete-system-not-working-out/#findComment-163474 Share on other sites More sharing options...
zhahaman2001 Posted January 18, 2007 Author Share Posted January 18, 2007 lol thanks, i know i couldnt think of a good way to do it Quote Link to comment https://forums.phpfreaks.com/topic/34686-checkbox-mail-delete-system-not-working-out/#findComment-163481 Share on other sites More sharing options...
Jessica Posted January 18, 2007 Share Posted January 18, 2007 You didn't need them at all though.Did that work? Quote Link to comment https://forums.phpfreaks.com/topic/34686-checkbox-mail-delete-system-not-working-out/#findComment-163482 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.