Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <html>
- <head>
- <title>RTK Gaming</title>
- </head>
- <body>
- <div align="center">
- <form method="post" >
- <label>RTK Gaming Account and IP Ban Checker.</label>
- <br>
- <br>
- <label>Account</label>
- <input type="text" name="accountname" />
- <br>
- <br>
- <input type="radio" name="ip" value="ipaddress" /><label>Ip Address</label>
- <br>
- <br>
- <input type="submit" name="Submit" value="Check Status" />
- </form>
- </div>
- </body>
- </html>
- <?php
- $account = $_POST["accountname"];
- $character = $_POST["charactername"];
- /*mysql Variables*/
- /*THIS IS WHERE YOU WANT TO SET YOUR SERVER ADDRESS, DATABASE AND LOGIN INFO*/
- $server = "localhost";
- $database = "realmd";
- $user = "root";
- $pass = "toor";
- if (isset($_POST['Submit']) and !isset($_POST["ip"]))
- {
- /*check to see if account name is banned*/
- if (!$link = mysql_connect("$server", "$user", "$pass"))
- {
- echo "Could Not Connect To MySQL " .mysql_error();
- exit;
- }
- if (!mysql_select_db($database, $link))
- {
- echo "Could Not Select Database!" . mysql_error();
- exit;
- }
- $sql = "SELECT id FROM account WHERE username='$account'";
- $result = mysql_query($sql, $link);
- if (!$result)
- {
- echo "DB ERROR, Could not Query the DataBase\n";
- echo "MySQL Error " .mysql_error();
- exit;
- }
- while ($id = mysql_fetch_assoc($result))
- {
- $accid = $id['id'];
- }
- mysql_freeresult($result);
- echo "Account name found.<br /><br />";
- $sql = "SELECT active, unbandate, bannedby, bandate, banreason FROM account_banned WHERE id='$accid'";
- $result = mysql_query($sql, $link);
- if (!$result)
- {
- echo "DB Error, Could not query DB\n";
- echo "<br />";
- echo "MySQL Error: " . mysql_error();
- }
- while ($ban = mysql_fetch_assoc($result))
- {
- $banned = $ban["active"];
- $banneddate = $ban["bandate"];
- $unbanned = $ban["unbandate"];
- $bannedby = $ban["bannedby"];
- $banreason = $ban["banreason"];
- }
- mysql_freeresult($result);
- if ($banned == "1")
- {
- echo "You Where Banned By $bannedby ! on the $banneddate";
- echo "<br />";
- echo "Please Contact an administrator if you do not know why.";
- echo "<br />";
- echo "You will be unbanned on the $unbanned";
- echo "<br />";
- echo "You Where Banned because $banreason";
- }
- else
- {
- echo "Your Account is not Banned!";
- exit;
- }
- /*end account check*/
- }
- /*ip Ban Check*/
- if (isset($_POST["Submit"]) and isset($_POST["ip"]))
- {
- if (!$link = mysql_connect("$server", "$user", "$pass"))
- {
- echo "Could Not Connect To MySQL " .mysql_error();
- exit;
- }
- if (!mysql_select_db($database, $link))
- {
- echo "Could Not Select Database!" . mysql_error();
- exit;
- }
- $ip = $_SERVER['REMOTE_ADDR'];
- $sql = "SELECT ip, bandate, unbandate, bannedby, banreason FROM ip_banned WHERE ip='$ip'";
- $result = mysql_query($sql, $link);
- if (!$result)
- {
- echo "DB Error, Could not query DB\n";
- echo "<br />";
- echo "MySQL Error: " . mysql_error();
- }
- while ($ipban = mysql_fetch_assoc($result))
- {
- $banned = $ipban["ip"];
- $bandate = $ipban["bandate"];
- $unbandate = $ipban["unbandate"];
- $bannedby = $ipban["bannedby"];
- $bannedreason = $ipban["banreason"];
- }
- //The date function in this if statement can be changed to how ever you want to format the date.
- if ($banned == $ip)
- {
- if ($unbandate <= $bandate)
- {
- echo "You Have Been Perminatly Banned!!";
- echo "<br />";
- echo "If you do not know why you have been permninatly Banned Please Contact An Administrator.";
- exit;
- }
- echo "You Have Been Banned By Ip Address";
- echo "<br />";
- echo "You where Banned on ";
- echo date('m.d.y', $bandate);
- echo " You're Ban will be lifted on ";
- echo date('m.d.y', $unbandate);
- echo "<br />";
- echo "$bannedby has Banned you for $bannedreason";
- echo "<br />";
- echo "If you Disagree With this or this is not your doing then please Contact an Administrator.";
- }
- else
- {
- echo "You Are Good, No Ban";
- }
- mysql_freeresult($result);
- }
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement