Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- if(strtolower($email) != strtolower($dbemail)){
- $stmt = $db->prepare("INSERT INTO users (username, password, email, uniquekey) VALUES (?, ?, ?, ?)");
- $stmt->bind_param("ssss", $username, md5($password), $email, $uniquekey);
- }else{
- echo "<p>This email is already registered, please use a different email.</p>";
- }
- if( $stmt->execute()){
- $stmt->close();
- $db->close();
- header("Location: account.php");;
- }
- }else{
- echo "";
- $stmt = $db->prepare("SELECT * FROM users WHERE email=? and password=?");
- $stmt->bind_param("ss", $email, md5($password));
- $stmt->execute();
- $result = $stmt->get_result();
- if($result->num_rows > 0) {
- while($row = $result->fetch_assoc()) {
- $email = $row['email'];
- $username = $row['username'];
- $id = $row['id'];
- $_SESSION['admin'] = $row['role'];
- }
- $rows = mysqli_num_rows($result);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement