Advertisement
adventuretimeh

registrazione(esempio).php

Jul 6th, 2022
754
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.85 KB | None
  1. <html>
  2. <head>
  3. <style>
  4. body {
  5. background-color: lightblue;
  6. font-family: Arial, Helvetica, sans-serif;
  7. }
  8. * {
  9. box-sizing: border-box;
  10. }
  11. .container {
  12. padding: 16px;
  13. background-color: white;
  14. }
  15. input[type=text], input[type=password] {
  16. width: 100%;
  17. padding: 15px;
  18. margin: 5px 0 22px 0;
  19. display: inline-block;
  20. border: none;
  21. background: #f1f1f1;
  22. }
  23. input[type=text]:focus, input[type=password]:focus {
  24. background-color: #ddd;
  25. outline: none;
  26. }
  27. hr {
  28. border: 1px solid #f1f1f1;
  29. margin-bottom: 25px;
  30. }
  31. .registerbtn {
  32. background-color: #04AA6D;
  33. color: white;
  34. padding: 16px 20px;
  35. margin: 8px 0;
  36. border: none;
  37. cursor: pointer;
  38. width: 100%;
  39. opacity: 0.9;
  40. }
  41. .registerbtn:hover {
  42. opacity: 1;
  43. }
  44. a {
  45. color: dodgerblue;
  46. }
  47. .signin {
  48. background-color: #f1f1f1;
  49. text-align: center;
  50. }
  51. }
  52. </style>
  53. </html>
  54. <?php
  55. if(empty($_POST['invia'])){
  56. echo"<FORM ACTION='".$_SERVER['PHP_SELF']."'METHOD='POST'>";
  57. echo "<p><center>database_registrazione";
  58. echo"<fieldset>";
  59. echo"<legend>registrazione</legend>";
  60. echo"<body>";
  61. echo"email:<br>";
  62. echo"<input type='text' placeholder='email' name='email' required><br>";
  63. echo"password:<br>";
  64. echo"<input type='text' placeholder='password' name='password' required><br>";
  65. echo"</div>";
  66. echo"</fieldset>";
  67. echo"<br><input type='submit' value='Invia'>";
  68. echo "</center>";
  69. echo"</body>";
  70. echo "<br>";
  71. echo"<br>";
  72. echo"<a href=accedi(esempio).php>accedi</a>";
  73. echo"</TABLE></FORM>";
  74. }
  75. $con=new mysqli("localhost","root","","esempio");
  76. if(mysqli_connect_errno()){
  77. echo("connesione_non_effetuata:".mysqli_connect_errno()."<BR>");
  78. exit();
  79. }
  80. $email=isset($_POST['email'])?$_POST['email']:'';
  81. $password=isset($_POST['password'])?$_POST['password']:'';
  82. $sql="INSERT INTO registrazione(email,password)";
  83. $sql.="VALUES('".$email."','".$password."');";
  84. $ris=$con->query($sql) or die ("query_fallita");
  85. $con->close();
  86. ?>
Advertisement
RAW Paste Data Copied
Advertisement