I have a couple pages I am working with.
One page named CombatAssets passes team_id to the page Movement.
But Movement does not pass the value onto the next page named Move.
CombatAssets does this.
<a href=\"modules.php?name=Campaign&file=Movement&team_id=$team_id\">" . _CLICK . "</a>
...with this at the bottom of the page.
. "<input type=\"hidden\" name=\"team_id\" value=\"$team_id\">"
The Movement page gets the value and I can display infomation based on the team_id which is what I want.
$id = intval($_GET['team_id']);
$sql = "SELECT * FROM " . $prefix . "_tc_ladderteams tclt WHERE team_id ='$id'";
I then have a dropdown onchange to pass the value onto the next couple of pages, and this is where I can't get the value passed correctly.
<select name="move" onchange="if(this.options[this.selectedIndex].value != 0){ document.location=this.options[this.selectedIndex].value; }">
<option value="0">--Choose option--</option>
<option value="modules.php?name=Campaign&file=Move&team_id=$id">Move</option>
<option value="modules.php?name=Campaign&file=Attack&team_id=$id">Attack</option>
<option value="modules.php?name=Campaign&file=MoveAttack&team_id=$id">Move and Attack</option>
</select>
At the bottom of Movement.php I have
echo"<input type=\"hidden\" name=\"id\" value=\"$id\">";
Then finally on my Move.php page I can't get the value and then display the unitname of the id I am trying to pass.
$id = intval($_GET['id']);
$sql = "SELECT * FROM " . $prefix . "_tc_ladderteams tclt WHERE team_id ='$id'";
$result = $db->sql_query($sql);
$info = $db->sql_fetchrow($result);
if (!$result) {
echo("<p>Error performing query: " . mysql_error() . "</p>");
exit();
} else {
$unitname = $info['name'];
}
Any help is appreciated.