Web Wiz - Green Windows Web Hosting

  New Posts New Posts RSS Feed - stopforumspam
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

stopforumspam

 Post Reply Post Reply Page  <1234 8>
Author
dbonline View Drop Down
Newbie
Newbie
Avatar

Joined: 16 September 2003
Location: United States
Status: Offline
Points: 15
Post Options Post Options   Thanks (0) Thanks(0)   Quote dbonline Quote  Post ReplyReply Direct Link To This Post Posted: 01 September 2011 at 3:22pm
MadDog,
 
Which pages would we add that if using WebWiz?
 
Back to Top
alabamatoy View Drop Down
Groupie
Groupie


Joined: 04 February 2006
Location: United States
Status: Offline
Points: 143
Post Options Post Options   Thanks (0) Thanks(0)   Quote alabamatoy Quote  Post ReplyReply Direct Link To This Post Posted: 02 September 2011 at 2:16pm
Great discussion, thanks all, especially the code snippet.  I was going to try to xlate the PHP offered on the site into ASP, looks like I wont have to!!!
Big smile 
I added the stopforumspam http to mine as a test, and its been 100% dead-on correct so far.
Back to Top
pedigree@sfs View Drop Down
Newbie
Newbie


Joined: 01 September 2011
Status: Offline
Points: 3
Post Options Post Options   Thanks (0) Thanks(0)   Quote pedigree@sfs Quote  Post ReplyReply Direct Link To This Post Posted: 02 September 2011 at 9:12pm
great news, thats what I like to hear :)
Back to Top
MadDog View Drop Down
Mod Builder Group
Mod Builder Group
Avatar

Joined: 01 January 2002
Status: Offline
Points: 3008
Post Options Post Options   Thanks (0) Thanks(0)   Quote MadDog Quote  Post ReplyReply Direct Link To This Post Posted: 02 September 2011 at 9:14pm
Originally posted by dbonline dbonline wrote:

MadDog,
 
Which pages would we add that if using WebWiz?
 
I would place it in the register page to reduce the amount of times its called.
Back to Top
alabamatoy View Drop Down
Groupie
Groupie


Joined: 04 February 2006
Location: United States
Status: Offline
Points: 143
Post Options Post Options   Thanks (0) Thanks(0)   Quote alabamatoy Quote  Post ReplyReply Direct Link To This Post Posted: 10 September 2011 at 2:01pm
OK, I have this working in my older version of the forum.  I wrote a new function, which is called from register.asp.  If the user's email address, IP address or forum name appear in stopforumspam's database, I get a nice email saying they were blocked, and the prospective registrant is not allowed to register.  This has the secondary nice effect of the spammer not appearing at the bottom of the main page as the newest member.  Some of these spammers sign up with some pretty raunchy user names.

So its a new file in the functions folder, and two lines added to register.asp, and Bob's your uncle.

Im going to let it run for a day or two to make sure I dont see any errors then I'll post the code here.  stopforumspam seems to be pretty darn good so far!!!
Back to Top
pbanks View Drop Down
Groupie
Groupie


Joined: 22 August 2008
Location: Ireland
Status: Offline
Points: 70
Post Options Post Options   Thanks (0) Thanks(0)   Quote pbanks Quote  Post ReplyReply Direct Link To This Post Posted: 12 September 2011 at 10:30pm
Quote Im going to let it run for a day or two to make sure I dont see any errors then I'll post the code here.  stopforumspam seems to be pretty darn good so far!!!


I would certainly like to hear how this pans out for you ...
Back to Top
alabamatoy View Drop Down
Groupie
Groupie


Joined: 04 February 2006
Location: United States
Status: Offline
Points: 143
Post Options Post Options   Thanks (0) Thanks(0)   Quote alabamatoy Quote  Post ReplyReply Direct Link To This Post Posted: 12 September 2011 at 11:41pm

<%

'// Blacklists
Function IsUserBlacklisted(sIP, sName, sEMail)

Dim bBlacklisted
Dim objXMLHTTP

bBlacklisted = False

      '// We need to make sure we can actually create the MSXML object
      If IsObject(CreateObject("MSXML2.ServerXMLHTTP")) = False Then IsUserBlacklisted = "Error: MSXML2.ServerXMLHTTP could not be created, please check MSXML is installed (v6 or above is recommended)": Exit Function

      '// Check Blacklists
      set objXMLHTTP = CreateObject("MSXML2.ServerXMLHTTP")

      objXMLHTTP.open "GET", "http://www.stopforumspam.com/api?name=" & sName & "&email=" & sEMail & "&ip=" & sIP, false

      objXMLHTTP.send
      if objXMLHTTP.status = 200 then
         If Instr(1, objXMLHTTP.ResponseText, "yes", 1) > 0 Then
          bBlacklisted = True
         'Create blocked message email
            strEmailBody = "Registrant " & strUsername & " at IP address " & getip() & " attempted to register with email " & STREmail & " and was found in the blacklist by stopforumspam."
         'Send the e-mail using the Send Mail function created on the send_mail_function.inc file
         blnSentEmail = SendMail(strEmailBody, strTxtForumAdmin, decodeString(strForumEmailAddress), strMainForumName, decodeString(strForumEmailAddress), "new registrant BLACKLISTED", strMailComponent, false)
      end if
      end if
      set objXMLHTTP = nothing
      IsUserBlacklisted = bBlacklisted
End Function

%>

This seems to work so far.  You can use this function wherever you want to return a boolean for whether or not the username, IP address, or email passed to it is found in the stopforumspam DB.  There's a whole bunch of error checking that can be done with the "status" property, but 200 is just "OK" according to MS.  I put the call in register.asp where the user is already being checked to see if the IP has been blacklisted.
 
Create a file in the "functions" folder with the name "isuserblacklisted.asp"  Paste the above code into it.
 
Add the following line at the top of register.asp where the other functions are:
<!--#include file="functions/function_IsUserBlacklisted.asp" -->
Then I added the following to line 634 of register.asp:
'check if user is blacklisted
    if IsUserBlacklisted(getIP(), strUserName, STREmail) then blnEmailBlocked = True
If anyone has improvements to this, please speak up.  Im just a jackleg coder, after all, copying stuff that others have done and taking credit for it.  :-)  Most of all, if you see some degernate situation where it wont work, please let me know as well.
Back to Top
pbanks View Drop Down
Groupie
Groupie


Joined: 22 August 2008
Location: Ireland
Status: Offline
Points: 70
Post Options Post Options   Thanks (0) Thanks(0)   Quote pbanks Quote  Post ReplyReply Direct Link To This Post Posted: 13 September 2011 at 12:58am
Are you sure about the exact positioning in line 634 of register.asp of the code?
Back to Top
 Post Reply Post Reply Page  <1234 8>

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.08
Copyright ©2001-2026 Web Wiz Ltd.


Become a Fan on Facebook Follow us on X Connect with us on LinkedIn Web Wiz Blogs
About Web Wiz | Contact Web Wiz | Terms & Conditions | Cookies | Privacy Notice

Web Wiz is the trading name of Web Wiz Ltd. Company registration No. 05977755. Registered in England and Wales.
Registered office: Web Wiz Ltd, Unit 18, The Glenmore Centre, Fancy Road, Poole, Dorset, BH12 4FB, UK.

Prices exclude VAT at 20% unless otherwise stated. VAT No. GB988999105 - $, € prices shown as a guideline only.

Copyright ©2001-2026 Web Wiz Ltd. All rights reserved.