I am really new to php with only background in html and MSSQL.
The basics of what I am trying to do is this. I have modified a great little module for phpnuke that is for recipes to allow users to add battle reports. Now the fun part I am into right now is modifying the drop boxes. The first box will allow you to select the game, which will allow you to choose in the next two drop boxes the army for each side. This box will populate based on the game. I need to pass the variable from the category to those two drop boxes. Then to use the two armies chosen to populate a thrid drop box with each army chosen above and with the choice of "draw".
I can populate the drop boxes at the moment, but passing the variables has me stumped. I can't figure out how to do it within the code given. Can anyone provide any help?
The relevant code:
<center>
<table border=0>
<tr><td align=\""._ALIGNMENT2."\"><b>"._REPORTNAME.":</td><td><input type=text name=reportname size=\"50\" value=\"$reportname\"></td></tr>
<tr><td align=\""._ALIGNMENT2."\"><b>"._CATEGORY.":</td><td><select name=cat_id[] $multiple>";
$sql="select * from ".$_SESSION["reportprefix"]."_categories order by category";
$result = $db->sql_query($sql);
while ($row = $db->sql_fetchrow($result)) {
if ($cat_id==0) {$cat_id=$row[id];}
if ($cat_id==$row[id]) {$sel="selected";} else {$sel="";}
echo "<option value=$row[id] $sel>$row[category]";
};
echo "</select>";
if ($_SESSION["multi_category"]) {echo "\n<br><small>"._MULTIBLECOMMENT."</small>";}
echo "</td></tr>
<input type=hidden name=op value=add>
<input type=hidden name=contributer value=\"$user_name\">
<tr><td align=\""._ALIGNMENT2."\"><b>"._ARMIES.":</td><td><select name=army_id[] $multiple>";
$sql="select * from ".$_SESSION["reportprefix"]."_armies order by armyname"
where $cat_id=game_system;
$result = $db->sql_query($sql);
while ($row = $db->sql_fetchrow($result)) {
if ($army_id==0) {$army_id=$row[id];}
if ($army_id==$row[id]) {$sel="selected";} else {$sel="";}
echo "<option value=$row[id] $sel>$row[armyname]";
};
echo "</select>";
if ($_SESSION["multi_category"]) {echo "\n<br><small>"._MULTIBLECOMMENT."</small>";}
echo "</td></tr>
<input type=hidden name=op value=add>
<input type=hidden name=contributer value=\"$user_name\">
<tr><td align=\""._ALIGNMENT2."\"><b>"._ARMIES.":</td><td><select name=army_id[] $multiple>";
$sql="select * from ".$_SESSION["reportprefix"]."_armies order by armyname";
$result = $db->sql_query($sql);
while ($row = $db->sql_fetchrow($result)) {
if ($army_id==0) {$army_id=$row[id];}
if ($army_id==$row[id]) {$sel="selected";} else {$sel="";}
echo "<option value=$row[id] $sel>$row[armyname]";
};
echo "</select>";
if ($_SESSION["multi_category"]) {echo "\n<br><small>"._MULTIBLECOMMENT."</small>";}
echo "</td></tr>
<input type=hidden name=op value=add>
<input type=hidden name=contributer value=\"$user_name\">
Any help would be appreciated. Thanks!