rendered paste body<? //global_session('counter');include("config.php");$counter = 0; ?><html><head><script src="select.js"></script><link rel="stylesheet" type="text/css" href="admin.css" /> <script>var dropdown_count;var dropdown_count = 1;function addEvent() { var ni = document.getElementById('myDiv'); var numi = document.getElementById('theValue'); var num = (document.getElementById("theValue").value -1)+ 2; numi.value = num; var divIdName = "my"+num+"Div"; var newdiv = document.createElement('div'); newdiv.setAttribute("id",divIdName); newdiv.innerHTML = "<? pc_dropdown(); ?> <a href=\"javascript:;\" onclick=\"removeElement(\'"+divIdName+"\')\">[X]</a><p><div id=cattag_1_1_\'"+dropdown_count+"\'>Subcategory info will be listed here. Dropdown#: "+dropdown_count+"</div></p>"; ni.appendChild(newdiv);}function removeElement(divNum) { var d = document.getElementById('myDiv'); var olddiv = document.getElementById(divNum); d.removeChild(olddiv);}</script><?function pc_dropdown() {$counter++;$query="SELECT name,id FROM category WHERE site = 1";$result = mysql_query ($query);echo "<select name=cattag_1_1_\"+ dropdown_count++ +\" value='' onchange=showUser(this.value,$counter)>CatTag 1</option>";while($nt=mysql_fetch_array($result)){echo "<option value=$nt[id]>$nt[name]</option>";}echo "</select>";echo $counter;}