HTML Tutorial


 Forum HomeForum Home   FAQFAQ   SearchSearch   MemberlistMemberlist   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
RegisterRegister - Not registered yet? Got something to say? Join HTML Code Tutorial!
Getting two variables from a PHP loop
Post new topic   Reply to topic    HTML Help Forum Index -> PHP
View previous topic :: View next topic  
Author Message
chibs



Joined: 18 May 2007
Posts: 1

PostPosted: Fri May 18, 2007 2:02 am     Getting two variables from a PHP loop Reply with quote

Hi Everyone,
I have a huge problem. I am trying to get two corresponding variables
from a Checkbox and a Text box. e.g. If I check a value, say:
enrolled? [] (checkbox) then I have to put the date enrolled as a
text. So when inserting in a table I want the enrolled to correspond
to each date. Here is what I am trying but not working (In the echos
is where I am trying to have the values into the table):

while (list($key, $val) = @each ($box))
{
echo "$val";
while (list($key, $v_val) = @each ($dose))
{
echo "$v_val";
}


}


echo "<form method=post action=''>";
echo "<table border='0' cellspacing='0' style='border-collapse:
collapse' width='100' >

<tr bgcolor='white'>
<td width='25%'><input type=checkbox name=box[] value='John'></td>
<td width='13%'>&nbsp;John</td>
<td width='12%'><input type=text name=date[] size=8></td>
<td width='25%'><input type=checkbox name=box[] value='Peter'></td>
<td width='13%'>&nbsp;Peter</td>
<td width='12%'><input type=text name=date[] size=8></td>
......
.....
Display posts from previous:   
Post new topic   Reply to topic    HTML Help Forum Index -> PHP All times are GMT - 8 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
HTML Help Archive
Powered by phpBB © 2001, 2005 phpBB Group
HTML Help topic RSS feed 

 
HOSTING / DESIGN
MAKE MONEY

Home
  |   Tutorials   |   Forum   |   Quick List   |   Link Directory   |   About
Copyright ©1997-2002 Idocs and ©2002-2007 HTML Code Tutorial