Jump to content

[SOLVED] IP checker


sandrob57

Recommended Posts

I have all users ip saved in a database in table "fusion_users" and field "user_ip". I want to make a list that displays all ips, in order of most used (as well as all the field "user_name" for each person that uses it)

 

How would I do this?

 

I can start you off with this:

 

     

$result1 = dbquery("SELECT user_ip FROM fusion_users WHERE LIMIT $rowstart,20");

Link to comment
Share on other sites

Naturally he will be reviewing each case manually, not automatically banning the ip :)

 

If you're using mysql, you can use

 

SELECT user_ip, group_concat(user_name) as usernames FROM fusion_users GROUP BY user_ip HAVING count(*) > 1

 

That should give you something like:

 

user_ip    usernames

1.2.3.4    btherl,btherlseviltwin

Link to comment
Share on other sites

Naturally he will be reviewing each case manually, not automatically banning the ip :)

 

If you're using mysql, you can use

 

SELECT user_ip, group_concat(user_name) as usernames FROM fusion_users GROUP BY user_ip HAVING count(*) > 1

 

That should give you something like:

 

user_ip    usernames

1.2.3.4    btherl,btherlseviltwin

What would be the variables to spit this out?

 

This is a preview of what I get:

http://lunarwars.net/iplist.php

 

When I use the following:

 

      $result1 = dbquery("
SELECT user_ip, group_concat(user_name) as usernames FROM fusion_users GROUP BY user_ip HAVING count(*) > 1 LIMIT $rowstart,20");
  	  
      while ($data = dbarray($result1)) {

         $cell_color = ($i % 2 == 0 ? "tbl1" : "tbl2"); $i++;

	 $place = $i + $rowstart;

         echo "\n<td class='$cell_color'>".$data['user_ip']."</td>";
         echo "\n<td class='$cell_color'>".$data['user_name']."</td><tr>";	 
      }

      echo "</table>\n";

Link to comment
Share on other sites

Aha, I gave the column a different name.  The "group_concat(user_name) AS usernames" means "Name the column usernames".  So you would just replace user_name with usernames, and it should work fine :)

 

Edit: Replace $data['user_name'] with $data['usernames'], I mean.

Link to comment
Share on other sites

Can I just say that if your checking IP addresses to see if someone has signed up twice and then block them. This is not a clever way of solving the problem as on one IP there can more than 1 computer (we have 6 computers on one IP). You are going to lose users this way.

 

A better way to do it is check if someone has two or more accounts and then delete them after a period of time if they don't use the account

 

 

Link to comment
Share on other sites

Magnetica, how do you tell if someone has two or more accounts?

 

The system I've used in the past (with mixed success) is to find the users coming from the same ip, and to ask them why they are on the same ip.  If they give a good explanation, then I let them be and monitor them for signs of cheating.  If no response but they are still logging in, then ban them (and allow them to message me to request unbanning).

Link to comment
Share on other sites

As long as they're not transferring anything from one account to the other, you don't even really need to ask them. I mean, if it's two people playing and they don't help each other, that's fine, right? If it's one person, and they just want to play so much that they want two seperate accounts, who cares?

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.