Find Duplicate Members

Snitz™ Forums 2000
https://forum.snitz.com/forumTopic/Posts/67971?pagenum=1
05 November 2025, 02:34

Topic


garyrobar
Find Duplicate Members
16 December 2008, 11:37


Wrote a quick script to more easily point out duplicate posters (BY IP ADDRESS)

Just replace part with your own conn string, and your own url...(in caps lock below) This is meant to be saved as it's own page.

You get a print out of any members with an IP address that another member also has. It orders by IP address, so you can easily see what members are creating mults.

I typically delete the duplicates that have no posts. Sometime I'll move all posts under the oldest account for the same person.
Code:

<table border-collapse="separate" style="border:1px solid #D8D8D8;" cellpadding="9" cellspacing="1">
<tr>
<td valign="top" class="border" align="left">
<div class="title" style="text-align: left;">Find Duplicate Member Profiles</div>

<p>This table shows the contents of the url fields in the user profiles.</p>
<table cellpadding="3" class="stattable" style="border-collapse: collapse;">
<tr bgcolor="#e0e0e0">
<td align="center">Member ID</td>
<td align="center">Posts</td>
<td align="center">Member Name</td>
<td align="center">IP Address</td>
<td align="center">Email</td>
</tr>
<%
dim gfn, grs, gSQL


Set gfn = Server.CreateObject("ADODB.Connection")
gfn.Open [#########YOUR CONN STRING#########] Set grs = Server.CreateObject("ADODB.RecordSet")

gSQL = "select member_id, m_posts, m_name, m_ip, m_email from forum_members order by m_ip"

grs.Open gSQL, gfn, adOpenStatic

if grs.eof then
response.write "<tr><td> -na- </td><td>0</td><td>0</td></tr>"
else

thisloop = "5555555555"
lastloop = "8888888888"

do while not grs.eof
i=i+1
lastloop = currentloop
currentloop = grs("m_ip")
outputlast = output

'put current row in the variable
output = "<tr><td><a target=""_new"" href=""http://www.YOURURL.TLD/forum/pop_profile.asp?mode=display&id=" & grs("member_id") & """>" & grs("member_id") & "</a></td><td>" & grs("m_posts") & "</td><td>" & grs("m_name") & "</td><td>" & grs("m_ip") & "</td><td>" & grs("m_email") & "</td></tr>"


if currentloop = lastloop then
if flag = 1 then '---is a subsequent - so only print curr row
response.write output
else
response.write outputlast
response.write output
end if
flag = 1
else
flag = 0
end if

grs.movenext

loop
end if

grs.Close
Set grs = Nothing
gfn.Close
Set gfn= Nothing
Set gSQL = Nothing
%>
</table>
<%
response.write "<p>There were " & i & " total duplicates found in the table.</p>"
%>
</td>
</tr>
</table>

<

 

Replies ...


Etymon
16 December 2008, 11:44


Hi Gary,

Thanks for the code! smile
Hey, Just a quick question ... have you ever encountered multiple IP Addresses per member before?
I've seen it before where the m_ip field would look like this for example (replace the 0's with real numbers):

000.000.000.000, 000.000.000.000

<
garyrobar
16 December 2008, 12:02


let me have a quick look....<
HuwR
16 December 2008, 12:06


this is quite common, and is related to proxy servers. there is a mod/fix about that sorts it out<
HuwR
16 December 2008, 12:08


and by the way, just because more than one member shares an ip address does not mean they are a duplicate poster or even the same person for that matter<
AnonJr
16 December 2008, 12:08


You've got to be careful when using just the IP. If multiple members are in the same college dorm they could appear to have the same IP. Even the e-mail address may be different as I've had a couple double-entrants with different IPs and different e-mails - the rest of the profile was the same and in their post they mentioned that they were the same person.
Having said that, it looks like you've got that reasonably well in hand by linking to the profile page.
As a side note, if you put your code in the [ scrollcode ] tags (sans spaces) it will make it a little easier on the eyes and keep people from having to scroll the page to read replies. wink<
garyrobar
16 December 2008, 12:10


I checked, and the IP field "m_ip" (and m_last_ip) and all of my data is clean.

Have you added many/any mods that might have caused that?

Basically, there is no way that one member can register from two locations, right? When you find the multiples, are they the same IP? or Different IP?
I wonder if the network the user is behind effectively pushes a "multiple IP" range, instead of just one IP? For example, what if someone registered from within a google data center where there are many IP's and probably some load balancers...??? Just trying to figure all possibilities.<
HuwR
16 December 2008, 12:15


as i said above, it is todo with proxy servers. each proxy you are passed through appends it's ip to the end of the variabl<
garyrobar
16 December 2008, 12:27


yeah, I get that there can be multiple legit users at the same IP - It's more just to let me eye-up those abusers....for example, It helps me spot spammers....here is a group of spam profiles that someone manually registered that appears to be cellphone industry spammers. (0 posts over all of their accounts) Since they were registered over a number of days, It wasn't totally obvious. They registered the spam names, then registered what looks like a bunch of legit names after that to hide the spam member from "newest member" - then there is probably some bot that goes back, logs in, and posts spam...
Again, it's just a way for me to eye the member list where there are more that 1 use of an IP.
Code:


1049 0 comaero 212.247.71.34 212.247.71.34 fones4all@outgun.com
1149 0 mobile3601 212.247.71.34 212.247.71.34 mobile3601@outgun.com
1089 0 iphone_ltd 212.247.71.34 212.247.71.34 iphone_ltd@yahoo.com
1097 0 iphonss 212.247.71.34 212.247.71.34 iphonss@yahoo.com
1103 0 saleslimited01 212.247.71.34 212.247.71.34 angeloquadri@outgun.com
1044 0 comelimited 212.247.71.34 212.247.71.34 com22ster@outgun.com

and

1130 0 daustin2008 195.166.237.254 195.166.237.254 daustin2008@yahoo.com
1048 0 feroda 195.166.237.254 195.166.237.254 ferodaaccout2@yahoo.com
1045 0 IPHONE 195.166.237.254 195.166.237.254 kabiru3@outgun.com
1100 0 cupidlimited 195.166.237.254 195.166.237.254 cupidlimited@outgun.com
1064 0 company_item 195.166.237.254 195.166.237.254 adex4go@yahoo.com
1068 0 salemobile002 195.166.237.254 195.166.237.254 salemobile002@yahoo.com

<
Classicmotorcycling
17 December 2008, 00:01


For some reason the code was removed for admin_duplicate_ips.asp:

Code:
<%
'#################################################################################
'## Copyright (C) 2000-02 Michael Anderson, Pierre Gorissen,
'## Huw Reddick and Richard Kinser
'##
'## This program is free software; you can redistribute it and/or
'## modify it under the terms of the GNU General Public License
'## as published by the Free Software Foundation; either version 2
'## of the License, or any later version. '##
'## All copyright notices regarding Snitz Forums 2000
'## must remain intact in the scripts and in the outputted HTML
'## The "powered by" text/logo with a link back to
'## http://forum.snitz.com in the footer of the pages MUST
'## remain visible when the pages are viewed on the internet or intranet. '##
'## This program is distributed in the hope that it will be useful,
'## but WITHOUT ANY WARRANTY; without even the implied warranty of
'## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
'## GNU General Public License for more details. '##
'## You should have received a copy of the GNU General Public License
'## along with this program; if not, write to the Free Software
'## Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. '##
'## Support can be obtained from support forums at:
'## http://forum.snitz.com
'##
'## Correspondence and Marketing Questions can be sent to:
'## reinhold@bigfoot.com
'##
'## or
'##
'## Snitz Communications
'## C/O: Michael Anderson
'## PO Box 200
'## Harpswell, ME 04079
'#################################################################################
%>
<!--#INCLUDE FILE="config.asp"-->
<!--#INCLUDE FILE="inc_sha256.asp"-->
<!--#INCLUDE FILE="inc_header.asp" -->
<!--#INCLUDE FILE="inc_func_admin.asp" -->
<%
if Session(strCookieURL & "Approval") <> "15916941253" then
scriptname = split(request.servervariables("SCRIPT_NAME"),"/")
Response.Redirect "admin_login.asp?target=" & scriptname(ubound(scriptname))
end if

Response.Write " <table border=""0"" width=""100%"">" & vbNewLine & _
" <tr>" & vbNewLine & _
" <td width=""33%"" align=""left"" nowrap><font face=""" & strDefaultFontFace & """ size=""" & strDefaultFontSize & """>" & vbNewLine & _
" " & getCurrentIcon(strIconFolderOpen,"","") & " <a href=""default.asp"">All Forums</a><br />" & vbNewLine & _
" " & getCurrentIcon(strIconBar,"","") & getCurrentIcon(strIconFolderOpen,"","") & " <a href=""admin_home.asp"">Admin Section</a><br />" & vbNewLine & _
" " & getCurrentIcon(strIconBlank,"","") & getCurrentIcon(strIconBar,"","") & getCurrentIcon(strIconFolderOpenTopic,"","") & " Duplicate IP Addresses<br /></font></td>" & vbNewLine & _
" </tr>" & vbNewLine & _
" </table>" & vbNewLine & _
"<center><table cellpadding=""4"" cellspacing=""0"" width=""780"">" & vbNewLine & _
" <tr>" & vbNewLine & _
" <td valign=""top"" align=""left"">" & vbNewLine & _
" <font face=""" & strDefaultFontFace & """ size=""" & strDefaultFontSize & """ color=""" & strDefaultFontColor & """>Find Duplicate Member IP Addresses:<br /><br />" & vbNewLine & _
" This table shows the contents of the IP Address in the user profiles that are duplicates.</font><br /><br />" & vbNewLine & _
" <table style=""border:1px solid #" & strTableBorderColor & ";"" cellpadding=""3"" cellspacing=""0"">" & vbNewLine & _
" <tr>" & vbNewLine & _
" <td width=""100"" bgcolor=""" & strCategoryCellColor & """><font face=""" & strDefaultFontFace & """ size=""" & strDefaultFontSize & """ color=""" & strCategoryFontColor & """>Member ID</font></td>" & vbNewLine & _
" <td width=""50"" bgcolor=""" & strCategoryCellColor & """><font face=""" & strDefaultFontFace & """ size=""" & strDefaultFontSize & """ color=""" & strCategoryFontColor & """>Posts</font></td>" & vbNewLine & _
" <td width=""190"" bgcolor=""" & strCategoryCellColor & """><font face=""" & strDefaultFontFace & """ size=""" & strDefaultFontSize & """ color=""" & strCategoryFontColor & """>Member Name</font></td>" & vbNewLine & _
" <td width=""190"" bgcolor=""" & strCategoryCellColor & """><font face=""" & strDefaultFontFace & """ size=""" & strDefaultFontSize & """ color=""" & strCategoryFontColor & """>IP Address</font></td>" & vbNewLine & _
" <td width=""350"" bgcolor=""" & strCategoryCellColor & """><font face=""" & strDefaultFontFace & """ size=""" & strDefaultFontSize & """ color=""" & strCategoryFontColor & """>Email</font></td>" & vbNewLine & _
" </tr>" & vbNewLine


Set rs = Server.CreateObject("ADODB.RecordSet")

strSql = "SELECT MEMBER_ID, M_POSTS, M_NAME, M_IP, M_EMAIL FROM " & strMemberTablePrefix & "MEMBERS ORDER BY M_IP"

rs.Open strSql, my_Conn, adOpenForwardOnly, adLockReadOnly, adCmdText

if rs.eof then
response.write " <tr>" & vbNewLine & _
" <td> -na- </td>" & vbNewLine & _
" <td>0</td>" & vbNewLine & _
" <td>0</td>" & vbNewLine & _
" </tr>" & vbNewLine
else
thisloop = "5555555555"
lastloop = "8888888888"

do while not rs.eof
i=i+1
lastloop = currentloop
currentloop = rs("m_ip")
outputlast = output

'put current row in the variable
output = " <tr>"
output = output & " <td><a target=""_new"" href=""" & strForumURL & "pop_profile.asp?mode=display&id=" & rs("member_id") & """><b><font face=""" & strDefaultFontFace & """ size=""" & strDefaultFontSize & """ color=""" & strDefaultFontColor & """>" & rs("member_id") & "</font></b></a></td>"
output = output & " <td><font face=""" & strDefaultFontFace & """ size=""" & strDefaultFontSize & """ color=""" & strDefaultFontColor & """>" & rs("m_posts") & "</font></td>"
output = output & " <td><font face=""" & strDefaultFontFace & """ size=""" & strDefaultFontSize & """ color=""" & strDefaultFontColor & """>" & rs("m_name") & "</font></td>"
output = output & " <td><font face=""" & strDefaultFontFace & """ size=""" & strDefaultFontSize & """ color=""" & strDefaultFontColor & """>" & rs("m_ip") & "</font></td>"
output = output & " <td><font face=""" & strDefaultFontFace & """ size=""" & strDefaultFontSize & """ color=""" & strDefaultFontColor & """>" & rs("m_email") & "</font></td>"
output = output & " </tr>"

if currentloop = lastloop then
if flag = 1 then '---is a subsequent - so only print curr row
response.write output
else
response.write outputlast
response.write output
end if
flag = 1
else
flag = 0
end if

rs.movenext

loop
end if

rs.Close
Set rs = Nothing

response.write " </table></center>" & vbNewLine & _
" <p><font face=""" & strDefaultFontFace & """ size=""" & strDefaultFontSize & """ color=""" & strDefaultFontColor & """>There are a total of <b>" & i & "</b> IP Addresses found in the Database.</font></p>" & vbNewLine & _
" </td>" & vbNewLine & _
" </tr>" & vbNewLine & _
"</table>" & vbNewLine

WriteFooter
Response.End
%>
texanman
17 December 2008, 12:38


Neat David! Thanks
Of course need to add a line in the admin_home.asp to point to admin_duplicate_ips.asp.<
Giumer
30 December 2008, 02:37


HuwR
30 December 2008, 04:18


me forum is Image and is www.giumer.it
Then go to image for help.<
Giumer
30 December 2008, 06:02


sorry mate , this mods not is for Image , i'am include this file and me forum , and have this problem , and sorry for me english , and sorry for post ! np , delete this post and thx !<
HuwR
30 December 2008, 06:04


we do not offer assistance with anything relating to Images forums, MODs or other wise, sorry, but if you have a problem then take it up with image.<
Giumer
30 December 2008, 07:10


ok thx nly for info yuo have problem for Image ? tis mods not is for Image , np<
PackYakcouk
01 January 2009, 09:17


I have just added Classicmotorcycling's code to my forum and have linked it to admin_home.asp.
When i login click admin options and launch the page all i see is the below


isnt it suposed to list all members and point out duplicates? or have i missed something ?<
AnonJr
01 January 2009, 10:50


Unless I missed something, its only going to show duplicates. I would guess that you don't have any members that it considers duplicates.<
PackYakcouk
01 January 2009, 11:32


Oh brilliant!

thanks for that, i thought it was going to list EVERY member then highlight the duplicates wink
ta!<
bobby131313
17 January 2009, 20:36


This page is awesome!
I'm wondering though if there's maybe a bit of code that could be added to exclude a list of IP's from being included on the page. AOL proxies for example. It would remove a good bit of clutter from mine for sure.<
garyrobar
10 April 2009, 11:13


yup, that would be totally possible. You could hard-code, or add a table to the database.
MikeB.Lynn
16 April 2009, 00:26


I get this:

Microsoft VBScript compilation error '800a0401'

Expected end of statement

/testdupmem.asp, line 4

dim gfn, grs, gSQLSet gfn
-------------------------^
HuwR
16 April 2009, 02:35


that bit of code should be on two line

dim gfn, grs, gSQL
Set gfn

recheck your code against what was posted in the topic
MikeB.Lynn
16 April 2009, 07:32


When I use the path to my db file:
gfn.Open[/forum/fpdb/snitz_forums_2000.mdb]

I get this:

Microsoft OLE DB Provider for ODBC Drivers error '80004005'
[Microsoft][ODBC Driver Manager] Data source name not found and no default driver specified

/forum/testdupmem.asp, line 18
MikeB.Lynn
16 April 2009, 08:04


Never mind I just got it. Sorry
Giumer
22 May 2009, 11:09


hi mate plz i ,am have 3 accaunts and me forum and ip is equal but if I go to see it doesn't visualize them to me it tells only me the total one of the ips, my database and in MSQL. me look only this

Find Duplicate Member IP Addresses:

This table shows the contents of the IP Address in the user profiles that are duplicates.
Member ID Posts Member Name IP Address Email

There are a total of 26 IP Addresses found in the Database.
thx for help
garyrobar
18 June 2009, 07:47


show me the SQL code you are using...I'll fix and send back...
© 2000-2021 Snitz™ Communications