Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- $db = mysql_connect('localhost', 'username', 'password') or die ('Could not connect: ' . mysql_error());
- echo ('Database connection complete');
- mysql_select_db('databasename') or die ('Could not select database');
- $email = mysql_real_escape_string($_GET['email'], $db);
- $username = mysql_real_escape_string($_GET['username'], $db);
- $password = mysql_real_escape_string($_GET['password'], $db);
- $hash = $_GET['hash'];
- $secretKey = 'secretkey';
- $real_hash = md5($email . $username . $password . $secretKey);
- if ($real_hash == $hash)
- {
- $query = "INSERT INTO users (username, password, creationdate, email) values ('$username', '$password', NOW(), '$email');";
- $result = mysql_query($query) or die('Query failed: ' . mysql_error());
- }
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement