Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <!DOCTYPE html>
- <html>
- <head>
- <meta charset="utf-8">
- <title>Post-registratie</title>
- </head>
- <body>
- <?php
- require_once('connectvars.php');
- $dbc = mysqli_connect(HOST, USER, PASS, DNBNAME);
- if (mysqli_connect_error()) {
- echo "MySQL fout: " . mysqli_connect_error();
- }
- if (isset($_POST['submit'])) {
- $username = mysqli_real_escape_string($dbc,trim($_GET['username']));
- $email = mysqli_real_escape_string($dbc,trim($_GET['email']));
- $password = mysqli_real_escape_string($dbc,trim($_GET['password']));
- $hashed_password = hash('sha512',$password);
- $random_number = rand(1000,9999);
- $hashcode = hash('sha512',$random_number);
- $query = "INSERT INTO instaclone_users
- VALUES (0,'$username','$hashed_password','$email','$hashcode',0)";
- $result = mysqli_query($dbc,$query) or die ('Problemen met de gebruiker toe te voegen');
- $to = $email;
- $from = '22617@ma-web.nl';
- $subject = 'Inschrijving Instaclone | Verificatie';
- $message = 'Bedankt voor het registreren! ' .
- 'Je account is gecreëerd. Je kan inloggen op je account met je inloggegevens nadat je account geactiveerd is.' .
- 'Klik op de onderstaande link om je account te activeren:' .
- 'http://www.link.nl/verify.php?email=' . $email . '&hashcode=' .$hashcode;
- mail($to,$subject,$message,'From' . $from);
- }
- if (!isset($_POST['submit'])) {
- echo '<br>Vieze hacker! Je komt er niet in!';
- echo '<br>Als je er in wilt komen moet je gewoon <a href="register.php">hier</a> gewoon even klikken!';
- exit();
- }
- ?>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement