Du kannst nicht mehr als 25 Themen auswählen Themen müssen entweder mit einem Buchstaben oder einer Ziffer beginnen. Sie können Bindestriche („-“) enthalten und bis zu 35 Zeichen lang sein.

74 Zeilen
3.0KB

  1. <!DOCTYPE html>
  2. <html>
  3. <title>W3.CSS</title>
  4. <meta name="viewport" content="width=device-width, initial-scale=1">
  5. <link rel="stylesheet" href="https://www.w3schools.com/w3css/4/w3.css">
  6. <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css">
  7. <body>
  8. <form action="" method="post" class="w3-container w3-card-4 w3-light-grey w3-text-blue w3-margin">
  9. <h2 class="w3-center">Reģistrēties</h2>
  10. <div class="w3-row w3-section">
  11. <div class="w3-col" style="width:50px"><i class="w3-xxlarge fa fa-user"></i></div>
  12. <div class="w3-rest">
  13. <input class="w3-input w3-border" name="vards" type="text" autocomplete="off" required placeholder="Vārds">
  14. </div>
  15. </div>
  16. <div class="w3-row w3-section">
  17. <div class="w3-col" style="width:50px"><i class="w3-xxlarge fa fa-user"></i></div>
  18. <div class="w3-rest">
  19. <input class="w3-input w3-border" name="uzvards" type="text" autocomplete="off" required placeholder="Uzvārds">
  20. </div>
  21. </div>
  22. <div class="w3-row w3-section">
  23. <div class="w3-col" style="width:50px"><i class="w3-xxlarge fa fa-envelope-o"></i></div>
  24. <div class="w3-rest">
  25. <input class="w3-input w3-border" name="epasts" type="text" autocomplete="off" required placeholder="epasts">
  26. </div>
  27. </div>
  28. <div class="w3-row w3-section">
  29. <div class="w3-col" style="width:50px"><i class="w3-xxlarge fa fa-phone"></i></div>
  30. <div class="w3-rest">
  31. <input class="w3-input w3-border" required name="telefons" autocomplete="off" type="text" placeholder="Telefona nr.">
  32. </div>
  33. </div>
  34. <div class="w3-row w3-section">
  35. <div class="w3-col" style="width:50px"><i class="w3-xxlarge fa fa-lock"></i></div>
  36. <div class="w3-rest">
  37. <input class="w3-input w3-border" name="parole" autocomplete="off" type="password" required>
  38. </div>
  39. </div>
  40. <p class="w3-center">
  41. <input type="submit" name="registreties" class="w3-button w3-section w3-blue w3-ripple" value="Reģistrēties">
  42. </p>
  43. </form>
  44. <?php
  45. include('include/db.php');
  46. if(isset($_POST['registreties']))
  47. {
  48. //Ja nospiesta poga reģistrēties, sagatavosim visus ievadītos laukus saglabāšanai DB.
  49. $vards= mysqli_real_escape_string($conn, $_POST['vards']);
  50. $uzvards=mysqli_real_escape_string($conn, $_POST['uzvards']);
  51. $epasts=mysqli_real_escape_string($conn, $_POST['epasts']);
  52. $telefons=mysqli_real_escape_string($conn, $_POST['telefons']);
  53. $parole=mysqli_real_escape_string($conn, $_POST['parole']);
  54. $parolehash=password_hash($parole, PASSWORD_DEFAULT);
  55. //Veidojam vaicājumu, lai izveidotu lietotāju. kurš var ielogoties sistēmā.
  56. $register="INSERT INTO tbLietotaji (UsrMail,UsrParole,UsrAdmin) VALUES ('$epasts','$parolehash',0);";
  57. //Veidojam vaicājumu, kurš saglabās lietotaja datus tabulā Klienti
  58. $pievlietotaju = "INSERT INTO tbKlietni (KlientaVards,KlientaUzvards,KlientaEpasts,KlientaTel) VALUES ('$vards','$uzvards','$epasts','$telefons');";
  59. //Izpildām abus vaicājumus
  60. mysqli_query($conn,$register);
  61. mysqli_query($conn,$pievlietotaju);
  62. }
  63. ?>
  64. </body>
  65. </html>

Powered by TurnKey Linux.