<?php
$connessione=mysql_connect("localhost", "root", "") or die(mysql_error());
$selezione_db=mysql_select_db("iscrizione") or die(msyql_error());
?>
<doctype html public "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>Iscriviti al mio sito!</title>
</head>
<body>
Iscriviti al mio sito, cosi potrai accedere alle aree riservate. La procedura č semplice: compila il modulo sottostante. Ti ricordo che i campi segnati con l'asterisco (*) sono obbligatori.
<form name="modulo" action="elabora_form.php" method="post">
<table width="433">
<tr><td width="118">Scegli un username*:</td><td width="305"><input type="text" name="ob_username" size="12" maxlength="12"></td></tr>
<tr><td width="118">Scegli una password*:</td><td width="305"><input type="password" name="ob_password" size="12" maxlength="12"></td></tr>
<tr><td width="118">Nome:</td><td width="305"><input type="text" name="nome" size="20" maxlength="30"></td></tr>
<tr><td width="118">Cognome:</td><td width="305"><input type="text" name="cognome" size="20" maxlength="30"></td></tr>
<tr><td width="118">Indirizzo:</td><td width="305"><input type="text" name="indirizzo" size="40" maxlength="200"></td></tr>
<tr><td height="36" width="118">Cittā:</td><td height="36" width="305"><input type="text" name="citta" size="40" maxlength="100"></td></tr>
<tr><td height="24" width="118">Provincia:</td><td height="24" width="305"><select name="provincia">
<?php
$stringa_query="select * from province";
$elenco_province=mysql_query($stringa_query) or die(mysql_error());
while($row_province=mysql_fetch_array($elenco_prov ince)){
$id_provincia=$row_province[id];
$nome_provincia=$row_province[nome_provincia];
echo "<option value=\"$id_provincia\">$nome_provincia</option>\n";
}
?>
</select></td></tr>
<tr><td width="118">Email*:</td><td width="305"><input type="text" name="ob_indirizzo_email" size="40" maxlength="100"></td></tr>
<tr><td height="39" width="118">Data di nascita:</td>
<td height="39" width="305">
<select name="giorno">
<?php
for($i=1;$i<32;$i++){
echo "<option value=\"$i\">$i</option>\n";
}
?>
</select>
<select name="mese">
<?php
for($i=1;$i<13;$i++){
echo "<option value=\"$i\">$i</option>\n";
}
?>
</select>
<select name="anno">
<?php
for($i=1920;$i<2005;$i++){
echo "<option value=\"$i\">$i</option>\n";
}
?>
</select>
</td></tr>
<tr>
<td colspan="2" align="center"><input type="submit" value="iscriviti!" name="invio">
</tr>
</table>
</form>
</body>
</html>