<?php <form method="post" enctype="multipart/form-data" name="upload"> <table class="page" cellpadding="0" cellspacing="1"> <tr> <th class="naglowek2" colspan="2">Dodaj</th> </tr> <tr> <th>Nazwa</th> <th><input name="nazwa" type="text" value=""></th> </tr> <tr> <th>Kategoria</th> <th><select name="kategoria" onChange="redirect(this.options.selectedIndex)">'); $zapytanie_kat = zapytanie('download_kategorie', '1=1'); while($row = mfa($zapytanie_kat)){ } echo '<script> var groups=document.upload.kategoria.options.length var group=new Array(groups) for (i=0; i<groups; i++) group[i]=new Array() group[0][0]=new Option("Website Abstraction","http://wsabstract.com") group[0][1]=new Option("News.com","http://www.news.com") group[0][2]=new Option("Wired News","http://www.wired.com") group[1][0]=new Option("CNN","http://www.cnn.com") group[1][1]=new Option("ABC News","http://www.abcnews.com") group[2][0]=new Option("Hotbot","http://www.hotbot.com") group[2][1]=new Option("Infoseek","http://www.infoseek.com") group[2][2]=new Option("Excite","http://www.excite.com") group[2][3]=new Option("Lycos","http://www.lycos.com") var temp=document.upload.podkategoria function redirect(x){ for (m=temp.options.length-1;m>0;m--) temp.options[m]=null for (i=0;i<group[x].length;i++){ temp.options[i]=new Option(group[x][i].text,group[x][i].value) } temp.options[0].selected=true } function go(){ location=temp.options[temp.selectedIndex].value } </script>'; </tr> <tr> <th>Plik</th> <th><input type="file" name="upload"></th> </tr> <tr> <th><input type="reset" value="Wyczyść"></th> <th><input type="submit" value="Wgraj" name="submit"></th> </tr> </table> </form>'); ?>
W skrypcie JS zmieniałem tylko nazwy formularzy. Mój problem jest w tym aby wyprintować tablice JS z bazy MySQLa. Jak to zrobić??