- Home
- Categorie
- Coding e Sistemistica
- Coding
- Pagina di registrazione che non scrive sul db
- 
							
							
							
							
							
Pagina di registrazione che non scrive sul dbRagazzi ho questa pagina che nn mi scrive sul db sto usendo pazzo help ::: 
 ?
 include_once"dbCon.php";if(isset($_POST['register'])){ 
 echo $_POST["nome"]; echo $_POST["cognome"]; echo $_POST["codiceFiscale"]; echo $_POST["partitaIva"]; echo $_POST["password"]; echo $_POST["email"]; echo "TIPO ABB:".$_POST["abbonamento"];
 echo $_POST["note"];$nome=$_POST["nome"]; $cognome=$_POST["cognome"]; $codiceFiscale= $_POST["codiceFiscale"]; $partIva = $_POST["partitaIva"]; $password=$_POST["password"]; $email=$_POST["email"]; 
 $abbonamento=$_POST["abbonamento"]; $note=$_POST["note"];$create_member = mysql_query("INSERT INTO utenti(id,nome,cognome,codiceFiscale,partIva,email,password,abbonamento,note) VALUES
 ($nome,$cognome,$codiceFiscale,$partIva',$email,$password,$abbonamento,$note)"); connessione($create_member); } /*if($username == NULL OR $password == NULL OR $email == NULL){ $final_report.= "Please complete the form below.."; }else{ if(strlen($username) <= 3 || strlen($username) >= 30){ $final_report.="Your username must be between 3 and 30 characters.."; }else{ $check_members = mysql_query("SELECT * FROMmembersWHEREusername` = '$username'");
 if(mysql_num_rows($check_members) != 0){
 $final_report.="The username is already in use!";
 }else{
 if(strlen($password) <= 6 || strlen($password) >= 12){
 $final_report.="Your password must be between 6 and 12 digits and characters..";
 }else{
 if(!eregi("^[_a-z0-9-]+(.[_a-z0-9-]+)@[a-z0-9-]+(.[a-z0-9-]+)(.[a-z]{2,3})$", $email)){
 $final_report.="Your email address was not valid..";
 }else{"INSERT INTO utenti (nome, cognome, codiceFiscale, partIva, email, password, abbonamento, note) VALUES 
 ('$nome', '$cognome', '$codiceFiscale', '$partIva','$email, $password', '$abbonamento','$note')";
 }}}}}}
 */?><table border="0" > 
 <form method="post">
 <tr>
 <td>Nome:</td>
 <td><input type="text" maxlength="10" name="nome" id="nome"> Massimo 10 caratteri(Campo obbligatorio)</td>
 </tr>
 <td>Cognome:</td>
 <td><input type="text" name="cognome" maxlength="10" id="cognome"> Massimo 10 caratteri(Campo obbligatorio)</td>
 </tr>
 <tr>
 <td>Codice Fiscale:</td>
 <td><input type="text" maxlength="16" name="codiceFiscale" id="codiceFiscale"> Il codice fiscale è composto da 16 caratteri alfanumerici(Campo obbligatorio)</td>
 </tr>
 <tr>
 <td>Partita Iva:</td>
 <td><input type="text" name="partitaIva" id="partitaIva"> La partita IVA è composta da 11 cifre (Campo obbligatorio)</td>
 </tr>
 <tr>
 <td>Email:</td>
 <td><input type="text" name="email" id="email"> Massimo 20 caratteri(Campo obbligatorio)</td>
 <tr>
 <tr>
 <td>Password:</td>
 <td><input type="password" name="password" id="password"> Massimo 5 caratteri(Campo obbligatorio)</td>
 <tr>
 <td>Conferma Password:</td>
 <td><input type="password" name="cpassword" id="cpassword"></td>
 </tr>
 <tr>
 <td>Tipo di abbonamento:</td>
 <td><select name="abbonamento"><?php
 $sql = "SELECT nomeAbbonamenti FROM tipoAbbonamenti";
 $rs=connessione($sql);
 while ($row = mysql_fetch_assoc($rs)) {
 echo "<option value="$row[nomeAbbonamenti]">$row[nomeAbbonamenti]</option>\n"; }?></select></td></tr>
 <tr>
 <td>Note:</td>
 <td> <textarea name="note" rows="5" cols="40" id="note"></textarea></td></tr>
 <tr><td><input name="register" type="submit" id="register" value="Register" /></td></tr></form></table></body> dbcon: 
 ?php
 function connessione($sql)
 {
 $dbuser="tex";
 $dbpass="tex";
 $dbname="assistenza";
 $dbhost="localhost";
 $connessione=mysql_connect($dbhost,$dbuser,$dbpass) or die("Connessione non riuscita: " . mysql_error());
 mysql_select_db($dbname) or die("Selezione del database non riuscita");
 $rs=mysql_query($sql);
 mysql_close($connessione);
 return $rs;
 }function closeconnessione($result) { mysql_free_result($result); }?> 
 
- 
							
							
							
							
							Ciao texcs, 
 manca la funzione mysql_query per la query:
 [php]
 mysql_query("INSERT INTO utenti (nome, cognome, codiceFiscale, partIva, email, password, abbonamento, note) VALUES
 ('$nome', '$cognome', '$codiceFiscale', '$partIva','$email, $password', '$abbonamento','$note')");
 [/php]
 
- 
							
							
							
							
							
È alla riga 9!! 
 
- 
							
							
							
							
							Usi gli apici sbagliati per i values, in ogni caso metti mysql_error per vedere se genera errore. 
 
- 
							
							
							
							
							
Dove e come fai un esempi per favore. 
 
- 
							
							
							
							
							Fai attenzione alle maiuscole e alla punteggiatura nei tuoi messaggi... 
 Per quanto riguarda la query prova in questo modo:
 [php]
 $create_member = mysql_query("INSERT INTOutenti(nome,cognome,codiceFiscale,partIva,email,password,abbonamento,note) VALUES
 ('$nome', '$cognome', '$codiceFiscale', '$partIva','$email', '$password', '$abbonamento','$note')") or die(mysql_error());
 [/php]