if(!isset($_POST['JoinFaction'])) {
echo '<form method="post" action="'.$page_name.'"><dl id="sample" class="dropdown" align="left">'
.'<dt><a href="#"><span>Recruiting Factions ['.$numrows.']</span>'
.'</a></dt><dd><ul>';
while($faction_re = mysql_fetch_array($sql)){
echo '<li><a href="#">'.$faction_re['f_name'].''
.'<span class="value">'.$faction_re['f_id'].'</span></a></li>';
}
echo '</ul></dd></dl></td>'
.'<td class="faction_bgcolour" align="center"><input type="image" '
.'name="JoinFaction" value="JoinFaction" width="54" height="45" '
.'src="images/global/game/faction/join_faction.png" /></td></form>';
//get output as a variable to use in later code
echo $selected_faction = '<span id="result"></span>';
} else { $selected_faction = '<span id="result"></span>';
echo '<div class="faction_text">Joined: '.$selected_faction.'.</div>';
}
when I:
echo $selected_faction;
in the if statement, it gets the right faction value (i'm using custom jquery drop down boxes by the way here).
The problem is that this id is not being passed to the else statement where i can update the database. I'm really not sure how I would pass the id on to the else statement.
echo $selected_faction is blank in the else clause
Any help would be greatly appreciated.