Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- // Gegevens ophalen uit register form en benoemen
- $username = $_POST['username'];
- $password = $_POST['password'];
- $password2 = $_POST['password2'];
- // Wachtwoord beveiligen
- $hash = sha1($username, $password);
- // Controleren of iets is ingevuld
- if (!empty($username) && !empty($password))
- {
- if($password == $password2)
- {
- $sql = "SELECT username FROM users WHERE username='$username'";
- $result = mysql_query($sql);
- if(mysql_fetch_array($result) < 1)
- {
- $sql = "INSERT INTO users (username, password, rank) VALUES ('$username', '$hash', 1)";
- mysql_query($sql);
- }
- else
- {
- echo "er is al iemand geregistreerd onder deze naam!";
- }
- }
- else
- {
- echo "Controleer of allebei de wachtwoorden gelijk zijn.";
- }
- }
- else
- {
- echo "Er is iets niet ingevuld.";
- }
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement