Name: Fitch
Class: Thief
Level: 15
instead of:
Name: Fitch Class: Thief Level: 15
Also I would like to retain Name, Class, and Level as variables, once the player finds an opponent he wants to fight. I will use Name, Class, and Level again.
Code: Select all
<script type='text/javascript'>
function select_opponent() {
var opponent_stats = document.getElementById('opponent').value;
document.getElementById('opponent_description').value = opponent_stats;
}
</script>
mysql_connect();
mysql_select_db('sok');
$result = mysql_query('select * from sokopps');
$options="";
while ($row=mysql_fetch_array($result)) {
$Class=$row["Class"];
$Name=$row["Name"];
$Level=$row["Level"];
$OppStats = "Name:".$Name ." Class: ". $Class ." Level: ". $Level;
$options.="<OPTION VALUE=\"$OppStats\">".$Name;
}
?>
<strong>Select Opponent:</strong>
<select id='opponent' name='opponent' onChange='select_opponent();'>
<OPTION VALUE=0>Choose your opponent
<?=$options?>
</SELECT>
</div>
<div id="apOppInfo">
<div id="apOppStats"><textarea id='opponent_description' name='opponent_description'>
</textarea></div>
<div id="apOppImage"></div>
</div>
<div id="apStratList">
<?php