rendered paste body<script type="text/javascript"><!--function addClassMenu(){ box = document.getElementById("class"); selclass = box.options[box.selectedIndex].value; var xmlHttp; try { // Firefox, Opera 8.0+, Safari xmlHttp=new XMLHttpRequest(); } catch (e) { // Internet Explorer try { xmlHttp=new ActiveXObject("Msxml2.XMLHTTP"); } catch (e) { try { xmlHttp=new ActiveXObject("Microsoft.XMLHTTP"); } catch (e) { alert("Your browser does not support AJAX!"); return false; } } } xmlHttp.onreadystatechange=function() { if(xmlHttp.readyState==4) { popup = document.getElementById("subClass") popup.innerHTML=xmlHttp.responseText; } } xmlHttp.open("GET","subClass.php?class=" + selclass,true); xmlHttp.send(null);}//--></script><?php$con = makeConnection(false);?><h1>Create Character</h1><p> Enter your WoW character's details: <form name="createChar" action="index.php" method="get"> <input type="hidden" name="page" id="page" value="accountstat" /> <input type="hidden" name="createchar" id="createchar" value="true" /> <table> <tr> <td>Character Name:</td> <td><input type="text" name="name" id="name" /></td> </tr> <tr> <td>Class:</td> <td> <select name="class" id="class" onchange="addClassMenu()"> <?php $res = mysql_query("SELECT id,name FROM class"); $i = 0; while ($row = mysql_fetch_array($res)) { $opts[$i] = $row; $i++; } $l = count($opts); if ($l > 0) { foreach ($opts as $key => $row) { $names[$key] = $row["name"]; } array_multisort($names, SORT_ASC, $opts); } foreach ($opts as $opt) { echo ("<option value=\"" . $opt["id"] . "\">" . $opt["name"] . "</option>"); } ?> </select> <select name="subClass" id="subClass"> </select> </td> </tr> <tr> <td>Level:</td> <td><input type="text" name="level" id="level" /></td> </tr> </table><br /> <input type="submit" name="submit" value="Create Character" /> <input type="reset" name="reset" value="Clear Form" /> </form></p><script type="text/javascript">addClassMenu();</script><?phpmysql_close($con);?>