Advertisement
Guest User

Untitled

a guest
May 12th, 2016
66
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.82 KB | None | 0 0
  1. <?php
  2.  
  3. $conn=mysql_connect("localhost","siteofaxiano","");
  4. if(!$conn){
  5. print("Connessione al server database non riuscita");
  6. exit;
  7. }
  8. $db=mysql_select_db("my_siteofaxiano");
  9. if(!$db){
  10. print("Connessione al database non riuscita");
  11. exit;
  12. }
  13.  
  14. $cognome=$_POST["cognome"];
  15. $nome=$_POST["nome"];
  16. $ruolo=$_POST["ruolo"];
  17. $password=$_POST["password"];
  18. $username=$_POST["username"];
  19. $password=md5($password);
  20.  
  21. if(($username==NULL)||($password==NULL)||($ruolo==NULL)||($cognome==NULL)||($nome==NULL)){
  22. header("location:index.html");
  23. exit;
  24. }else{
  25. $query = "INSERT INTO Utenti (Username,Password,IP,Email)VALUES ('$username','$password','$ip','$email')";
  26. $risultato = mysql_query($query);
  27. if(!$risultato){
  28. print("Registrazione non riuscita");
  29. exit;
  30. }else{
  31. header("location:visualizza.php");
  32. exit;
  33. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement