jaZon All American 27048 Posts user info edit post |
Page One
<? while ($row = mysql_fetch_array($result)){ ?>
<tr>
<td><input type="text" name="lots[]" size="13" maxlength="12" value=""></td>
<td><input type="checkbox" name="tanks[]" value="<? echo("$row[serial]"); ?>"></td>
</tr>
<? } ?>
Page Two
<?
$howmany = count($_SESSION['tanks']);
if ($howmany > 0){
foreach($_SESSION['tanks'] as $serial => $tank){
//Whatever
} }
?>
Yay, page two works fine. Now how do I get the lots on page two? Because the same method doesn't work.
At this point I just want to take the info inputted on page one and display it on paqe two
Lot0 - Serial0 Lot1 - Serial1 Lot2 - Serial2 etc.
The form on page one is dynamically generated from a datbase, btw, in case it wasn't obvious.
[Edited on April 23, 2007 at 12:03 PM. Reason : ]4/23/2007 12:01:26 PM |
Stein All American 19842 Posts user info edit post |
Uh...
$_POST ?
What exactly are you doing with sessions? 4/23/2007 12:17:57 PM |
jaZon All American 27048 Posts user info edit post |
Color me stupid then
How do I go about getting all of the POST variables displayed when there could be anywhere from 1-1000000000 of them depending on the situation 4/23/2007 12:22:58 PM |
Stein All American 19842 Posts user info edit post |
Exactly the same way you would with sessions. 4/23/2007 12:34:43 PM |
jaZon All American 27048 Posts user info edit post |
ha ha ha, well obviously I have no idea how to do it either way or I wouldn't be posting here 4/23/2007 12:41:33 PM |
Stein All American 19842 Posts user info edit post |
Use the foreach code you have on the root $_POST instead of $_POST['whatever']
At least I think that's what you're asking.
[Edited on April 23, 2007 at 12:45 PM. Reason : .] 4/23/2007 12:45:11 PM |
jaZon All American 27048 Posts user info edit post |
Yea, that looks right.
I'll give it a try in a few minutes and report back.
Thanks
*This is why you don't get someone who knows jack about web programming to do something for you*
[Edited on April 23, 2007 at 12:49 PM. Reason : ] 4/23/2007 12:49:44 PM |
jaZon All American 27048 Posts user info edit post |
Haven't tried it yet, but even if that works to iterate through all of the variables, I'm not sure how I'm going to get it to work like I want it to... 4/23/2007 1:02:49 PM |
jaZon All American 27048 Posts user info edit post |
*sigh* yea, that's not giving me anywhere near what i want
It'd work fine if it were only one variable, but I need to have the lot and tank linked
the way it is now it'll go through the loop, display the first variable passed, the lots[], complete the loop then display the tank on the following loop. I need it to drop both on the same loop. 4/23/2007 3:07:05 PM |
jaZon All American 27048 Posts user info edit post |
this is retardedly fucking difficult for such a simple problem
so i'm going to ghetto rig the fuck out of it
[Edited on April 23, 2007 at 5:15 PM. Reason : ] 4/23/2007 5:13:24 PM |