Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- $reg['voornaam'] = $_POST['voornaam'];
- $reg['achternaam'] = $_POST['achternaam'];
- $reg['mail'] = $_POST['mail'];
- $reg['adres'] = $_POST['adres'];
- $reg['postcode'] = $_POST['postcode'];
- $reg['plaats'] = $_POST['plaats'];
- $reg['land'] = $_POST['land'];
- $reg['telefoon_nummer'] = $_POST['telefoon_nummer'];
- $reg['ww'] = $dww;
- $reg['hash'] = $has1h;
- if ($reg['voornaam'] == '') {
- $fout = 'voornaam';
- }
- if ($reg['achternaam'] == '') {
- $fout = 'achternaam';
- }
- if ($reg['mail'] == '') {
- $fout = 'mail';
- }
- if ($reg['adres'] == '') {
- $fout = 'adres';
- }
- if ($reg['postcode'] == '') {
- $fout = 'postcode';
- }
- if ($reg['plaats'] == '') {
- $fout = 'plaats';
- }
- if ($reg['land'] == '') {
- $fout = 'land';
- }
- if ($reg['telefoon_nummer'] == '') {
- $fout = 'telefoon_nummer';
- }
- if ($deeww == '') {
- $fout = 'ww';
- }
- if ($fout == '') {
- // HIER GAAT DE INSERT QUERIE
- } else {
- header("Location: register.php?error=".$fout);
- die();
- }
- $servername = "localhost";
- $username = "root";
- $password = "";
- $dbname = "gameclub";
- // Create connection
- $conn = mysqli_connect($servername, $username, $password, $dbname);
- // Check connection
- if (!$conn) {
- die("Connection failed: " . mysqli_connect_error());
- }
- $sql = "INSERT INTO users (voornaam, achternaam, mail, adres, postcode, plaats, land, telefoon_nummer, ww, hash)
- VALUES ('".$reg['voornaam']."', '".$reg['achternaam']."', '".$reg['mail']."', '".$reg['adres']."', '".$reg['postcode']."', '".$reg['plaats']."', '".$reg['land']."', '".$reg['telefoon_nummer']."', '".$reg['ww']."', '".$reg['hash']."'";
- if (mysqli_query($conn, $sql)) {
- echo "New record created successfully";
- } else {
- echo "Error: " . $sql . "<br>" . mysqli_error($conn);
- }
- mysqli_close($conn);
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement