--- In [email protected], <[EMAIL PROTECTED]> wrote: > > ----- Original Message ----- > From: "kihmera_morgain" <[EMAIL PROTECTED]> > To: <[email protected]> > Sent: Friday, September 21, 2007 6:24 AM > Subject: [php-list] Making an PM system > > > This group has become my lifesaver LOL but i've run across another > problem, so i'm back to ask more questions. > > i'm working on a PM system for my site, most of it isnt a problem, but > im afraid one part is just ZOOM~ going right over my head. I'm > populating the Inbox by pulling up data from the database with a while > loop.. simple enough... okay but i want to put a checkbox at the end > of each row so that the user can choose to "select a message" to be > deleted or added to their savebox... im afraid this is the part that > is whizzing past me.. how do i associate the message info in a > particular row with the checkbox at the end of the row, and the > MessageID itself so that when a user clicks the checkbox and hits > "delete" or "save", it actually picks the right message to delete or > save..? i feel it should be blatantly obvious but i have a head cold > and my brain just isn't functioning this afternoon it seems because I > cant figure it out. I have a "MessageID" identifier for each message > in place in the database, but im just not sure how to go about setting > it up so that "if the user clicks checkbox "D", then the message with > the ID "4" is deleted." since my table rows are being generated by > the while loop itself. > > I fear my brain has totally melted today. Thank you for any help T_T > ------------------------------ > > <?php > //get messages from data base > $message[0]["id"] = "01"; > $message[0]["subject"] = "from fred"; > $message[1]["id"] = "02"; > $message[1]["subject"] = "from sue"; > > if (!isset($)POST["save"]) && !issest($_POST["delete"]) > { > echo('<form action="' . $_SERVER["PHP_SELF"] . '" method="post">' . "\n"); > echo("<table>\n"); > foreach($message as $online) > { > echo("<tr><td>" . $oneline["id"] . "</td><td>" . $oneline["subject"] . > "</td><td>"); > echo('<input type="checkbox" name="' . $oneline["id"] . 'check"></td>' . > "\n"); > } > echo("</table>\n"); > echo('<input type="submit" name="save" value="Save Selected">' . "\n"); > echo('<input type="submit" name="delete" value="Delete Selected">' . > "\n"); > echo("</form>\n"); > } > > if(isset($_POST["save"]) > { > foreach($message as $online) > { > if(!isset($POST[$online["id"] . "check"]) > { > //save $online["id"]; > } > // same again for delete >
thanks so much guys for the help! I haven't looked in depth into it yet and tried it out, but i'll let you know how it pans out :)
