query($query); if ($result1 != false) { while ($row = $result1->fetch(PDO::FETCH_ASSOC)) { $failed_logins = $row['failed_logins']; $email = $row['email']; // $website = $row['website']; $auto_lock = $row['auto_lock']; $attempts = $row['attempts']; $count = $attempts; $email = $row['email']; } } // $pUname = isset( $_POST['username'] )? $_POST['username']: false; // if ($failed_logins == '0') $email = ""; else $key = md5(uniqid(rand(), true)); $formtitle = "Banner Bar Login"; if (($error) && ($pUname)) $formtitle = "Incorrect Login Details!"; if ($error) $count = $count + 1; if (($failed_logins == '1') && ($pUname)) { //mysql_query("UPDATE settings SET attempts=" . $count) or die(mysql_error()); $conn->query("UPDATE $t_settings SET attempts='$count', keylock='$key'"); $attempts = $attempts + 1; $to = $email; $from = "BannerBar@noreply.com"; $subject = "Unlock code for Banner Bar"; $ip = getenv("REMOTE_ADDR"); $headers = "MIME-Version: 1.0" . "\r\n"; $headers .= "Content-type:text/html;charset=iso-8859-1" . "\r\n"; $headers .= "From: $from"; if (($attempts == $auto_lock) && ($email != "")) { $message = "Hello!
Your 'Banner Bar' login page unlock link as requested
Click Here to reset your login page"; mail($to, $subject, $message, $headers); } elseif (($attempts < $auto_lock) && ($email != "")) { $subject = "Invalid Login Attempt on Banner Bar"; $message = "Hello!
Someone from $ip Just made an Invalid Login Attempt on the 'Banner Bar' login page which is set to lock after $auto_lock failed attempts and so far there have been $attempts failed attempt(s)."; mail($to, $subject, $message, $headers); } } if (($failed_logins == '1') && ($attempts >= $auto_lock)) { include("locked.php"); exit(); } ?>

All invalid login attempts are emailed to the site administrator