Menu
Forums
All threads
Latest threads
New posts
Trending threads
New posts
Search forums
Trending
What's new
New posts
New profile posts
Latest activity
Members
Current visitors
New profile posts
Search profile posts
Upgrades
Log in
Register
What's new
Search
Search
Search titles only
By:
All threads
Latest threads
New posts
Trending threads
New posts
Search forums
Menu
Log in
Register
Navigation
Install the app
Install
More options
Contact us
Close Menu
Forums
Server Development
Habbo Retros
Habbo Q&A
Checktheban and include problem
JavaScript is disabled. For a better experience, please enable JavaScript in your browser before proceeding.
You are using an out of date browser. It may not display this or other websites correctly.
You should upgrade or use an
alternative browser
.
Reply to thread
Message
<blockquote data-quote="JoshuaS" data-source="post: 435271" data-attributes="member: 41738"><p>Hi DB.</p><p>I'm currently working on a cms with arcturus and i have a problem with my checktheban.php.</p><p>I use this:[SPOILER="checktheban.php"][PHP]</p><p><?php</p><p>$userID = (isset($_SESSION['user']['id'])) ? $_SESSION['user']['id'] : 0;</p><p>$ip = (isset($_SERVER["HTTP_CF_CONNECTING_IP"]) && !empty($_SERVER["HTTP_CF_CONNECTING_IP"])) ? $_SERVER["HTTP_CF_CONNECTING_IP"] : $_SERVER["REMOTE_ADDR"];</p><p>$getBan = mysql_query("SELECT * FROM bans WHERE user_id = '{$userID}' OR ip = '{$ip}' ORDER BY ban_expire DESC LIMIT 1");</p><p></p><p>while($ban = mysql_fetch_array($getBan))</p><p>{</p><p> if($ban['ban_expire'] >= time())</p><p> {</p><p> if($ban['type'] == 'account') die(header('Location: /banned'));</p><p></p><p> die(header('Location: /ipbanned'));</p><p> }</p><p>}</p><p>?></p><p>[/PHP][/SPOILER] and this[SPOILER="class.users"]</p><p>[PHP]final public function isBanned($value)</p><p> {</p><p> global $engine;</p><p> if($engine->num_rows("SELECT * FROM bans WHERE value = '" . $value . "' LIMIT 1") > 0)</p><p> {</p><p> return true;</p><p> }</p><p> </p><p> return false;</p><p> }</p><p> </p><p> final public function getReason($value)</p><p> {</p><p> global $engine;</p><p> return $engine->result("SELECT ban_reason FROM bans WHERE value = '" . $value . "' LIMIT 1");</p><p> }</p><p> </p><p> final public function hasClones($ip)</p><p> {</p><p> global $engine;</p><p> if($engine->num_rows("SELECT * FROM users WHERE ip_register = '" . $_SERVER['REMOTE_ADDR'] . "'") == 2) {</p><p> return true;</p><p> }</p><p> </p><p> return false;</p><p> }</p><p> [/PHP]</p><p>[/SPOILER]</p><p>The problem that i have is, that even when i ban someone, its not only the account, but it seems to be the whole ip. I'm using arcturus. I hope someone can help. </p><p>Thx</p></blockquote><p></p>
[QUOTE="JoshuaS, post: 435271, member: 41738"] Hi DB. I'm currently working on a cms with arcturus and i have a problem with my checktheban.php. I use this:[SPOILER="checktheban.php"][PHP] <?php $userID = (isset($_SESSION['user']['id'])) ? $_SESSION['user']['id'] : 0; $ip = (isset($_SERVER["HTTP_CF_CONNECTING_IP"]) && !empty($_SERVER["HTTP_CF_CONNECTING_IP"])) ? $_SERVER["HTTP_CF_CONNECTING_IP"] : $_SERVER["REMOTE_ADDR"]; $getBan = mysql_query("SELECT * FROM bans WHERE user_id = '{$userID}' OR ip = '{$ip}' ORDER BY ban_expire DESC LIMIT 1"); while($ban = mysql_fetch_array($getBan)) { if($ban['ban_expire'] >= time()) { if($ban['type'] == 'account') die(header('Location: /banned')); die(header('Location: /ipbanned')); } } ?> [/PHP][/SPOILER] and this[SPOILER="class.users"] [PHP]final public function isBanned($value) { global $engine; if($engine->num_rows("SELECT * FROM bans WHERE value = '" . $value . "' LIMIT 1") > 0) { return true; } return false; } final public function getReason($value) { global $engine; return $engine->result("SELECT ban_reason FROM bans WHERE value = '" . $value . "' LIMIT 1"); } final public function hasClones($ip) { global $engine; if($engine->num_rows("SELECT * FROM users WHERE ip_register = '" . $_SERVER['REMOTE_ADDR'] . "'") == 2) { return true; } return false; } [/PHP] [/SPOILER] The problem that i have is, that even when i ban someone, its not only the account, but it seems to be the whole ip. I'm using arcturus. I hope someone can help. Thx [/QUOTE]
Insert quotes…
Verification
Post reply
Forums
Server Development
Habbo Retros
Habbo Q&A
Checktheban and include problem
Top