canibalstew Posted August 5, 2009 Posted August 5, 2009 I am sure this is totally wrong but I am not so good at foreach and such. Please contribute what you can for everyones use. <?php include "globals.php"; /** * Canibalstew@author * Canibalstew@copyright 2009 */ $ipscan=mysql_query("SELECT COUNT(userid) AS username, lastip FROM users WHERE userid > 0 GROUP BY lastip",$c); $ipw=mysql_fetch_array($ipscan); while() $id=$ipw['userid']; foreach($id as $user) { $num=++; $ip2=mysql_query("SELECT userid FROM users WHERE lastip IN ({$user1['lastip']}) AND userid!={$user1['userid']} ",$c); } $counted=count($ip2); if($counted > 1) { $ip3=mysql_fetch_array($ip2); echo("{$ip3['username']} "); } else { exit; } Quote
Guest Sniko` Posted August 5, 2009 Posted August 5, 2009 Re: (not working) Auto Multi IP Check I am sure this is totally wrong but I am not so good at foreach and such. Please contribute what you can for everyones use. <?php include "globals.php"; /** * Canibalstew@author * Canibalstew@copyright 2009 */ $ipscan=mysql_query("SELECT COUNT(userid) AS username, lastip FROM users WHERE userid > 0 GROUP BY lastip",$c); $ipw=mysql_fetch_array($ipscan); while() $id=$ipw['userid']; foreach($id as $user) { $num=++; $ip2=mysql_query("SELECT userid FROM users WHERE lastip IN ({$user1['lastip']}) AND userid!={$user1['userid']} ",$c); } $counted=count($ip2); if($counted > 1) { $ip3=mysql_fetch_array($ip2); echo("{$ip3['username']} "); } else { exit; } if it doesnt work - whats the error? Quote
endo Posted August 5, 2009 Posted August 5, 2009 Re: (not working) Auto Multi IP Check a quick scan over it says its possibly because the while function is empty.... <?php include "globals.php"; /** * Canibalstew@author * Canibalstew@copyright 2009 */ $ipscan=mysql_query("SELECT COUNT(userid) AS username, lastip FROM users WHERE userid > 0 GROUP BY lastip",$c); $ipw=mysql_fetch_array($ipscan); while() //<---- function is empty? $id=$ipw['userid']; foreach($id as $user) { $num=++; $ip2=mysql_query("SELECT userid FROM users WHERE lastip IN ({$user1['lastip']}) AND userid!={$user1['userid']} ",$c); } $counted=count($ip2); if($counted > 1) { $ip3=mysql_fetch_array($ip2); echo("{$ip3['username']} "); } else { exit; } if it doesnt work - whats the error? Quote
canibalstew Posted August 5, 2009 Author Posted August 5, 2009 Re: (not working) Auto Multi IP Check lol... ok this is an incomplete or not working script as it never worked properly eventually would be set to do same as ip search and mass ban together but time is scarce for me atm so I posted it to allow a community perspective on it and figured it could grow and become a working mod for everyone's use. Quote
weewooz Posted August 5, 2009 Posted August 5, 2009 Re: (not working) Auto Multi IP Check not even half the script mate where you get that from there a few on here simlar or do the same thing just use the search mate Quote
PHP Scene Posted August 6, 2009 Posted August 6, 2009 Re: (not working) Auto Multi IP Check Little bored right now, so just put this together: <?php /* Coded by Danny [php Scene] Mccode version 2.0 */ include ('globals.php'); // Insert user_level IDs here, e.g 2 = admin. $userlevels = array(2, 3); // Deny file access to players, only admins and secretaries. if(!in_array($ir['user_level'], $userlevels)){ exit('Go away.'); } $query = mysql_query("SELECT `userid`, `username`, `lastip` FROM `users`"); echo ' <h2>Duplicate IP Checker</h2> <table>'; while($data = mysql_fetch_object($query)){ $select_dup = mysql_query("SELECT `userid`, `username`, `lastip` FROM `users` WHERE `lastip` = '{$data->lastip}' AND `userid` != '{$data->userid}'"); if(mysql_num_rows($select_dup)){ $dup_data = mysql_fetch_object($select_dup); echo '<tr> <td>[url="viewuser.php?u='.$dup_data->userid.'"]'.$dup_data->username.'[/url] ['.$dup_data->lastip.'] same IP as [url="viewuser.php?u='.$data->userid.'"]'.$data->username.'[/url] ['.$data->lastip.']</td> </tr>'; } } echo '</table>'; $h->endpage(); ?> I suppose it could be a little better optimized, yet it does the job of selecting out users with the same ip. Quote
canibalstew Posted August 6, 2009 Author Posted August 6, 2009 Re: (not working) Auto Multi IP Check thank you for your contribution. Quote
Agon Posted July 6, 2010 Posted July 6, 2010 Wanting to exclude IP's from displaying. For example, don't want ip addy 127.0.0.1 is displaying in the search results. Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.