Ryflex Posted October 10, 2011 Share Posted October 10, 2011 Hi all, Well I guess I am again asking to much from php/html. I'm trying to build a message system where you can select multiple messages to delete them of you click on the subject of the message and you open the message. Current code I have: <FORM ID="Search" NAME="Search" METHOD="POST" ACTION="/berichten-exec.php"> <ul CLASS="ul-ver" VALIGN="top"> <li><a CLASS="a-ver" href="berichten-verzenden.php">Nieuw Bericht</a></li> <li><INPUT CLASS="input" TYPE="SUBMIT" NAME="verwijderen" ID="verwijderen" VALUE="verwijderen"></INPUT></li> </ul> </TD> <TD> <TABLE WIDTH="825" CELLPADDING="0" ALIGN="RIGHT" CELLSPACING="0" BORDER="2" RULES="NONE" FRAME="BOX" STYLE="BORDER-COLOR:#F2952E"> <TR> <TH WIDTH="25"></TH> <TH WIDTH="200">Van</TH> <TH WIDTH="600">Bericht</TH> <TH WIDTH="100">Tijd</TH> <TH WIDTH="100">Datum</TH> </TR> <?php $foutmelding = ""; //Query voor het zoeken naar gemelde storingen $qry = mysql_query("SELECT * FROM `game-berichten` WHERE `aan` = '$login' ORDER BY id DESC LIMIT 0, 10"); if(!$qry) { $foutmelding = "Er zijn geen berichten voor je.".$login; } else { //While loop voor het vullen van de tabel while($row = mysql_fetch_assoc($qry)) { echo '<tr>'; echo '<td>'; ?> <INPUT NAME="checkbox[]" TYPE="checkbox" ID="checkbox[]" VALUE="<? echo $row['id']; ?>"> </td> <?php echo '<td>'; echo $row['van']; echo '</td>'; echo '<td>'; ?> <INPUT TYPE="hidden" NAME="id" VALUE="<?php echo $row['id']; ?>"></INPUT> <INPUT CLASS="bericht" TYPE="SUBMIT" NAME="bericht-open" ID="bericht-open" VALUE="<?php echo $row['onderwerp'];?>"></INPUT> <?php echo '</td>'; echo '<td>'; echo $row['tijd']; echo '</td>'; echo '<td>'; echo $row['datum']; echo '</td>'; echo '</tr>'; } } ?> <TR> <TD COLSPAN=5> <?php echo $foutmelding; ?> </TD></FORM> The exec page: if($_POST['bericht-open']) { $id = $_POST['id']; } echo $id; What happens at this point is that the id of the last message in the table will be displayed always. Who can help me out. Thanks Ryflex Quote Link to comment Share on other sites More sharing options...
haku Posted October 11, 2011 Share Posted October 11, 2011 Please post the HTML output of your PHP script. This is the HTML forum, and therefore there should be no PHP here. 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.