Modulo HTML:
- <!DOCTYPE html>
<html dir="ltr" lang="it">
<head>
<meta content="text/html; charset=UTF-8" http-equiv="content-type">
<title>Segnalazioni - anagrafe</title>
<meta content="G.Rolfini" name="author">
<style type="text/css">
#BG_1501056471721_713 {
color: #cc0000;
}
#BG_1501057003253_87070 {
background-color: #cccccc;
}
#BG_1501057085656_82076 {
color: #cc0000;
}
</style></head>
<body id="BG_1501057003253_87070">
<h1 style="text-align: center;"><span id="BG_1501056471721_713" style="font-family: sans-serif;">Gestione
segnalazioni</span></h1>
<h2 style=" text-align: center;"><span style="font-family: sans-serif;">Anagrafe</span></h2>
<h3 style="text-align: center;" class="A"><span id="BG_1501057085656_82076"
style="font-family: sans-serif;"></span></h3>
<p style="text-align: justify;" id="BG_1501056438949_97991"><br>
</p>
<form target="_self" enctype="text/plain" autocomplete="on" method="POST" action="input.php"
name="anagrafe">
<div style="text-align: justify;"><span style="font-family: sans-serif;">Id:
<input form="anagrafe" disabled="disabled" name="Id" type="number">
Cognome: <input autocomplete="on" maxlength="40" size="40" placeholder="Cognome"
form="anagrafe" name="Cognome:" type="text"> Nome: <input maxlength="40"
size="40" form="anagrafe" name="Nome" type="text"> Sesso <span style="font-family: sans-serif;"><input
maxlength="1" size="1" form="anagrafe" value="M" name="Sesso" type="text"><br>
<br>
Data di nascita: <input autocomplete="on" max="31/12/2050" min="01/01/1917"
form="anagrafe" name="data_nascita" type="date"> Luogo di nascita:
<input maxlength="50" size="50" placeholder="luogo di nascita" form="anagrafe"
name="luogo_nascita" type="text"> C.F.: <input autocomplete="on"
maxlength="16" size="16" placeholder="cod. fisc." form="anagrafe"
name="cod_fisc" type="text"> Età: <input step="1" max="120" min="18"
form="anagrafe" name="età" type="number"><br>
</span>
<hr style="width: 100%; height: 1px; color: white;"><span style="font-family: sans-serif;">Indirizzo:</span>
<input maxlength="100" size="100" placeholder="indirizzo" form="anagrafe"
name="Indirizzo" type="text"><span style="font-family: sans-serif;">
cap: <input autocomplete="on" maxlength="5" size="5" placeholder="cap"
form="anagrafe" name="cap" type="text"><br>
<br>
Località: <input autocomplete="on" maxlength="50" size="50" form="anagrafe"
name="localita" type="text"> Prov.<input autocomplete="on" maxlength="2"
size="2" placeholder="pr" form="anagrafe" name="prov" type="text"><br>
</span>
<hr style="width: 100%; height: 2px; color: white;"><span style="font-family: sans-serif;">Telefono:
<input maxlength="11" size="11" placeholder="telefono" form="anagrafe"
name="Telefono" type="tel"> Cellulare: <input maxlength="11"
size="11" placeholder="cell." form="anagrafe" name="cellulare" type="tel">
E-mail: <input autocomplete="on" maxlength="100" size="100" placeholder="e-mail"
form="anagrafe" name="email" type="email"><br>
<br>
</span>
<hr style="width: 100%; height: 1px; color: white;"><span style="font-family: sans-serif;">Note:<input
maxlength="500" size="160" placeholder="note" form="anagrafe" name="Note"
type="text"><br>
<br>
<br>
</span><span style="font-family: sans-serif;"></span></span></div>
<span style="font-family: sans-serif;"><br>
</span>
<p><br>
<button style="margin-top: -37px; height: 26px; width: 77px;" name="Inserisci"
type="submit">Inserisci</button> </p>
</form>
</body>
</html>
- <?
$host = "localhost";
$user = "root";
$password ="jurgen";
$database = "segnalazioni";
$link=mysql_connect($host,$user,$password)or die ("Non riesco a connettermi al server MySql.");
echo "Connessione riuscita.";mysql_select_db($database);
$cognome = $_POST['cognome'];
$nome = $_POST['nome'];
$sesso = $_POST['sesso'];
$data_nascita = $_POST['data_nascita'];
$luogo_nascita = $_POST['luogo_nascita'];
$indirizzo = $_POST['indirizzo'];
$cap = $_POST['cap'];
$localita = $_POST['localita'];
$prov = $_POST['pr'];
$cod_fisc = $_POST['cod_fisc'];
$tel = $_POST['telefono'];
$cel = $POST['cellulare'];
$email = $POST['email'];
$note = $POST['note'];
$toinsert = "INSERT INTO anagrafica (cognome, nome, data_nascita,luogo_nascita,indirizzo,cap,località,pr,cod_fisc,telefono,cellulare,email,note)
VALUES
('$cognome',
'$nome',
'$sesso',
'$data_nascita', '
$luogo_nascita',
'$indirizzo',
'$cap',
'$localita',
'$prov',
'$cod_fisc', '
$tel',
$cel',
'$email',
'$note')";
$result = mysql_query($toinsert); //order executes
if($result){
echo("<br>Inserimento avvenuto correttamente");
} else{
echo("<br>Inserimento non eseguito");
}
?>
- Inserimento avvenuto correttamente"); } else{ echo("
Inserimento non eseguito"); } ?>
Spero possiate aiutarmi a risolvere questo impasse. Vi ringrazio anticipatamente
Giorgio