Jump to content

Form inside Form


Ryflex

Recommended Posts

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

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.