Non è una pagina HTML, ma PHP, comunque:
Codice PHP:
<html><head> <title>readyschool</title> <meta name="keywords" content="compiti, esercizi, scuola, readyschool"> <meta name="description" content="Problemi a risolvere un esercizio? Readyschool è la soluzione..."> <meta name="author" content="Borgioli Niccolò"> <LINK rel=stylesheet href="stili/stile.css" type="text/css">
<!-- Inizo script js --> <script type="text/javascript"> function trova() { scuola_selezionata = document.getElementById('scuola').value; var ajax = new XMLHttpRequest(); //se c'è il supporto if(ajax) { //richiesta pagina con metodo post ajax.open("post", "materie.php", true); ajax.setRequestHeader("content-type", "application/x-www-form-urlencoded"); ajax.setRequestHeader("connection", "close"); ajax.send("scuola=" + scuola_selezionata); ajax.onreadystatechange = function() { if(ajax.readyState == 4) { if(ajax.status == 200 || ajax.status == 304) { //sistemo ciò che arriva testo = ajax.responseText; document.getElementById('materia').innerHTML = testo;document.getElementById('materia').removeAttribute('disabled'); } } } } } </script> <!--Fine script js--> <!-- Inizo 2° script js --> <script type="text/javascript"> function elenca() { autore_selezionato = document.getElementById('autore').value; var ajax = new XMLHttpRequest(); //se c'è il supporto if(ajax) { //richiesta pagina con metodo post ajax.open("post", "titoli.php", true); ajax.setRequestHeader("content-type", "application/x-www-form-urlencoded"); ajax.setRequestHeader("connection", "close"); ajax.send("autore=" + autore_selezionato); ajax.onreadystatechange = function() { if(ajax.readyState == 4) { if(ajax.status == 200 || ajax.status == 304) { //sistemo ciò che arriva testo = ajax.responseText; document.getElementById('titolo').innerHTML = testo;document.getElementById('titolo').removeAttribute('disabled'); } } } } } </script> <!--Fine 2° script js--></head><body> <H1>READYSCHOOL</H1> <form action="ricerca.php" method="post" name="ricerca"> <label>Tipo di scuola: <select name="scuola" id="scuola" onChange="trova();"> <option selected>-Seleziona-</option> <option>Elementare</option> <option>Medie</option> <option>Liceo Scientifico</option> <option>Liceo Classico</option> </select> </label> <label>Materia: <select name="materia" id="materia"> </select> </label> <label>Editore: <?php session_start(); error_reporting(E_ALL & ~E_NOTICE); require_once('mysqlconn.php'); mysql_select_db($database, $autori); $result = mysql_query("SELECT * FROM autori ORDER BY autore") or die('mysql_error()'); echo '<select name="autore" id="autore" required onChange="elenca();">'; while ($resrow = mysql_fetch_array($result)) { echo "<option>" .$autore = $resrow[autore]. "</option>";} echo '</select>'; ?> </label> <label>Titolo: <select name="titolo" id="titolo" required> </select> </label><br><br> <input type="reset" value="Azzera"> <input type="submit" name="aggiungi" id="aggiungi" title="Clic qui per confermare l'inserimento." value="Aggiungi"> </form> <br> Non trovi la soluzione all'esercizio che stai cercando? Hai tyrovato la soluzione da solo? <a href="inserimento.php">Pubblicala</a> e aiuta gli altri! </body></html>