Search IP

Failed Login Attempts"); print("\n"); if ($update) $msg = "\n"; $res = sql_query("SELECT * FROM loginattempts ORDER BY $orderby DESC $limit") or sqlerr(__FILE__,__LINE__); if (mysql_num_rows($res) == 0) print("\n"); else { print("". "\n"); while ($arr = mysql_fetch_assoc($res)) { $r2 = sql_query("SELECT id,username FROM users WHERE ip=".sqlesc($arr[ip])) or sqlerr(__FILE__,__LINE__); $a2 = mysql_fetch_assoc($r2); print("\n"); } } print($msg); print("
".htmlspecialchars($update)." Successful!
Nothing found
IDIp AddressAction TimeAttemptsAttempt TypeStatus
$arr[id]$arr[ip] " . ($a2[id] ? get_username($a2['id']) : "" ) . "$arr[added]$arr[attempts]".($arr[type] == "recover" ? "Recover Password Attempt!" : "Login Attempt!")."".($arr[banned] == "yes" ? "banned [unban]" : "not banned [ban]")." [delete] [edit]
\n"); if ($countrows > $perpage) echo ''.$pagerbottom.''; searchform(); stdfoot(); }elseif ($action == 'ban') { check($id); stdhead ("Max. Login Attemps - BAN"); safe_query("UPDATE loginattempts SET banned = 'yes'",$id,"Ban"); header("Location: maxlogin.php?update=Ban"); }elseif ($action == 'unban') { check($id); stdhead ("Max. Login Attemps - UNBAN"); safe_query("UPDATE loginattempts SET banned = 'no'",$id,"Unban"); }elseif ($action == 'delete') { check($id); stdhead ("Max. Login Attemps - DELETE"); safe_query("DELETE FROM loginattempts",$id,"Delete"); }elseif ($action == 'edit') { check($id); stdhead ("Max. Login Attemps - EDIT (".htmlspecialchars($id).")"); $query = sprintf("SELECT * FROM loginattempts WHERE id ='%s'", mysql_real_escape_string($id)); $result = sql_query($query) or sqlerr(__FILE__,__LINE__); $a = mysql_fetch_array($result); print("\n"); print(""); print(""); print(""); print(""); print(""); if ($_GET['return'] == 'yes') print(""); print(""); print(""); print(""); print("

IP Address: ".htmlspecialchars($a[ip])."

"); print("

Action Time: ".htmlspecialchars($a[added])."

Attempts "); print("
Attempt Type
Current Status
"); stdfoot(); }elseif ($action == 'save') { $id = sqlesc(intval($_POST['id'] ?? 0)); $ip = sqlesc($_POST['ip']); $attempts = sqlesc($_POST['attempts']); $type = sqlesc($_POST['type']); $banned = sqlesc($_POST['banned']); check($id); check($attempts); sql_query("UPDATE loginattempts SET attempts = $attempts, type = $type, banned = $banned WHERE id = $id LIMIT 1") or sqlerr(__FILE__,__LINE__); if ($_POST['returnto']){ $returnto = $_POST['returnto']; header("Location: $returnto"); } else header("Location: maxlogin.php?update=Edit"); }elseif ($action == 'searchip') { $ip = mysql_real_escape_string($_POST['ip']); $search = sql_query("SELECT * FROM loginattempts WHERE ip LIKE '%$ip%'") or sqlerr(__FILE__,__LINE__); stdhead ("Max. Login Attemps - Search"); print("

Failed Login Attempts

"); print("\n"); if (mysql_num_rows($search) == 0) print("\n"); else { print("". "\n"); while ($arr = mysql_fetch_assoc($search)) { $r2 = sql_query("SELECT id,username FROM users WHERE ip=".sqlesc($arr[ip])) or sqlerr(__FILE__,__LINE__); $a2 = mysql_fetch_assoc($r2); print("\n"); } } print("
Sorry, nothing found!
IDIp AddressAction TimeAttemptsAttempt TypeStatus
$arr[id]$arr[ip] " . ($a2[id] ? get_username($a2[id]) : "" ) . "$arr[added]$arr[attempts]".($arr[type] == "recover" ? "Recover Password Attempt!" : "Login Attempt!")."".($arr[banned] == "yes" ? "banned [unban]" : "not banned [ban]")." [delete] [edit]
\n"); searchform(); stdfoot(); } else stderr("Error","Invalid Action"); ?>