Advertisement
Guest User

Untitled

a guest
Sep 18th, 2017
52
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.54 KB | None | 0 0
  1. <form method="post" action="doIscrizione.php">
  2. <input id="nome" type="text" name="nome" value="Nome" onfocus="this.setAttribute('value','')">
  3. <br><br>
  4. <input id="cognome" type="text" name="cognome" value="Cognome" onfocus="this.setAttribute('value','')">
  5. <br><br>
  6. <input id="email" type="text" name="email" value="Email" onfocus="this.setAttribute('value','')">
  7. <br><br>
  8. <input id="useriscrizione" type="text" name="userid" value="UserId" onfocus="this.setAttribute('value','')">
  9. <input id="passwiscrizione" type="text" name="password" value="Password" onfocus="this.setAttribute('value','')">
  10. <br><br>
  11. <button id="iscriviti" type="button">Iscriviti</button>
  12. </form>
  13.  
  14. <?php
  15.  
  16. error_reporting(E_ALL);
  17. ini_set( 'display_errors','1');
  18.  
  19. session_start();
  20.  
  21. $nome = $_REQUEST["nome"];
  22. $cognome = $_REQUEST["cognome"];
  23. $email = $_REQUEST["email"];
  24. $userid = $_REQUEST["userid"];
  25. $password = $_REQUEST["password"];
  26.  
  27.  
  28.  
  29. $host = "localhost";
  30. $username = "root";
  31. $password = "";
  32. $db = "iscrizioni";
  33.  
  34.  
  35. $conn = new mysqli($host,$username,$password,$db);
  36.  
  37. if ($conn->connect_error) {
  38. die("Connection failed: " . $conn->connect_error);
  39. };
  40.  
  41. $sql ="INSERT INTO `iscrizioni`.`iscrizionitab` (`nome`, `cognome`, `email`,
  42. `userid`, `password`) VALUES ('$nome', '$cognome', '$email', '$userid',
  43. '$password')";
  44.  
  45. $result = $conn->query($sql);
  46.  
  47. $_SESSION["username"] = $userid;
  48. header('Location: http://localhost/SCHIF_Vizzini_Occhipinti/index.php');
  49. exit;
  50.  
  51. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement