Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- include("shortcuts/header.php");
- include("shortcuts/functions.php");
- $ip = $_SERVER['REMOTE_ADDR'];
- ?>
- <title>Registering - LegionPvP Forums</title>
- <div style="float:center"><div class="span7">
- <div class="hero-unit" style="padding: 7px;-webkit-border-radius: 12px;-moz-border-radius: 12px;border-radius: 12px;">
- <?php
- $logged = true;
- if(isset($_POST['login'])){
- $total = mysql_query("select * from login_attempts where ip = '".$ip."'");
- if(mysql_num_rows($total) >= 5){
- echo 'You have exceeded your login attempts.';
- }else{
- $grabuser = mysql_query("select * from users where username = '".$_POST['username']."'");
- if(empty($_POST['username']) || empty($_POST['password']))
- echo 'Please fill in both the username/password.';
- elseif(mysql_num_rows($grabuser) == 0){
- echo 'User doesn\'t exist';
- }else{
- $info = mysql_fetch_assoc($grabuser);
- $username = $info['username'];
- $password = $info['password'];
- if($password != (md5($_POST['password']))){
- echo 'Password is incorrect';
- $insert = mysql_query("insert into login_attempts (ip, time) VALUES ('".$ip."', '".time()."')");
- }else{
- $_SESSION['username'] = $username;
- header("Location: index.php");
- $logged = false;
- }
- }
- }
- }
- ?>
Add Comment
Please, Sign In to add comment