Advertisement
Guest User

Untitled

a guest
May 16th, 2016
75
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.02 KB | None | 0 0
  1. <?php
  2. $host="localhost"; // Hostname
  3. $username="maimar96x"; // Mysql username
  4. $password=""; // Mysql password
  5. $db_name="my_maimar96x"; //Nome del Database
  6. $tbl_name="members"; // Nome della Tabella
  7. $db = mysql_connect($localhost,$username,$password);
  8. mysql_select_db($db_name,$db);
  9.  
  10. $username = $_POST['username'];
  11. $password = $_POST['password'];
  12. $nome = $_POST['nome'];
  13. $cognome = $_POST['cognome'];
  14. $email = $_POST['email'];
  15. $permessi = "Utente";
  16. //if (!ereg ("@", $email)){
  17. // echo '<h3>Errore!</h3><br>Deve inserire una email valida<br>
  18. // La preghiamo di <a href="registrazione.html">tornare indietro e correggere</a>. Grazie';
  19. // exit;
  20. // };
  21.  
  22.  
  23.  
  24. mysql_query("INSERT INTO ".$tbl_name." (username,password,nome,cognome,email,Permessi) VALUES ('$username','$password','$nome','$cognome','$email','$permessi')",$db) || die(mysql_error());
  25.  
  26. /* quindi i dati sono stati salvati nel database e l'utente รจ registrato */
  27. mysql_close($db);
  28. header("location:reg_ok.html");
  29. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement