Advertisement
Guest User

Untitled

a guest
Apr 1st, 2017
98
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.72 KB | None | 0 0
  1. <?php
  2. $reg['voornaam'] = $_POST['voornaam'];
  3. $reg['achternaam'] = $_POST['achternaam'];
  4. $reg['mail'] = $_POST['mail'];
  5. $reg['adres'] = $_POST['adres'];
  6. $reg['postcode'] = $_POST['postcode'];
  7. $reg['plaats'] = $_POST['plaats'];
  8. $reg['land'] = $_POST['land'];
  9. $reg['telefoon_nummer'] = $_POST['telefoon_nummer'];
  10. $reg['ww'] = $dww;
  11. $reg['hash'] = $has1h;
  12.  
  13. if ($reg['voornaam'] == '') {
  14. $fout = 'voornaam';
  15. }
  16. if ($reg['achternaam'] == '') {
  17. $fout = 'achternaam';
  18. }
  19. if ($reg['mail'] == '') {
  20. $fout = 'mail';
  21. }
  22. if ($reg['adres'] == '') {
  23. $fout = 'adres';
  24. }
  25. if ($reg['postcode'] == '') {
  26. $fout = 'postcode';
  27. }
  28. if ($reg['plaats'] == '') {
  29. $fout = 'plaats';
  30. }
  31. if ($reg['land'] == '') {
  32. $fout = 'land';
  33. }
  34. if ($reg['telefoon_nummer'] == '') {
  35. $fout = 'telefoon_nummer';
  36. }
  37. if ($deeww == '') {
  38. $fout = 'ww';
  39. }
  40. if ($fout == '') {
  41. // HIER GAAT DE INSERT QUERIE
  42. } else {
  43. header("Location: register.php?error=".$fout);
  44. die();
  45. }
  46.  
  47.  
  48.  
  49.  
  50.  
  51. $servername = "localhost";
  52. $username = "root";
  53. $password = "";
  54. $dbname = "gameclub";
  55.  
  56. // Create connection
  57. $conn = mysqli_connect($servername, $username, $password, $dbname);
  58. // Check connection
  59. if (!$conn) {
  60. die("Connection failed: " . mysqli_connect_error());
  61. }
  62.  
  63. $sql = "INSERT INTO users (voornaam, achternaam, mail, adres, postcode, plaats, land, telefoon_nummer, ww, hash)
  64. VALUES ('".$reg['voornaam']."', '".$reg['achternaam']."', '".$reg['mail']."', '".$reg['adres']."', '".$reg['postcode']."', '".$reg['plaats']."', '".$reg['land']."', '".$reg['telefoon_nummer']."', '".$reg['ww']."', '".$reg['hash']."'";
  65.  
  66. if (mysqli_query($conn, $sql)) {
  67. echo "New record created successfully";
  68. } else {
  69. echo "Error: " . $sql . "<br>" . mysqli_error($conn);
  70. }
  71.  
  72. mysqli_close($conn);
  73. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement