Anti-spam Birthdate Add-on

Snitz™ Forums 2000
https://forum.snitz.com/forumTopic/Posts/63786?pagenum=1
04 November 2025, 18:35

Topic


Shaggy
Anti-spam Birthdate Add-on
18 January 2007, 09:20


This is a very simple little add-on that will dramatically reduce the number of spam registrations on your forums. While it won't stop spammers from manually registering for accounts, it will stimmy the vast majority of scripts and bots out there which are pre-programmed to only complete those fields that are required on the registration form. This add-on will make the date of birth (or age, depending on your setup) field required and throw an error if it isn't completed.
First, find the following on line 346 of inc_profile.asp:
Code:
"                      <td bgColor=""" & strPopUpTableColor & """ align=""right"" valign=""middle"" nowrap><b><font face=""" & strDefaultFontFace & """ size=""" & strDefaultFontSize & """>Age: </font></b></td>" & vbNewLine & _
And replace it with the following:
Code:
"                      <td bgColor=""" & strPopUpTableColor & """ align=""right"" valign=""middle"" nowrap><b><font face=""" & strDefaultFontFace & """ size=""" & strDefaultFontSize & """><font color=""" & strHiLiteFontColor & """>*</font> Age: </font></b></td>" & vbNewLine & _
Find the following on line 374:
Code:
"                      <td bgcolor=""" & strPopUpTableColor & """ align=""right"" valign=""middle"" nowrap><b><font face=""" & strDefaultFontFace & """ size=""" & strDefaultFontSize & """>Birth Date: </font></b></td>" & vbNewLine & _
And replace it with the following:
Code:
"                      <td bgcolor=""" & strPopUpTableColor & """ align=""right"" valign=""middle"" nowrap><b><font face=""" & strDefaultFontFace & """ size=""" & strDefaultFontSize & """><font color=""" & strHiLiteFontColor & """>*</font> Birth Date: </font></b></td>" & vbNewLine & _
Find the following on lines 1150 and 1465 (which will become line 1471 after the first edit) of pop_profile.asp and on line 381 of register.asp:
Code:
if len(strMAge) > 0 then
if not isNumeric(strMAge) then
Err_Msg = Err_Msg & "<li>You must enter a numerical value for your age.</li>"
elseif strMinAge > 0 and strMAge < strMinAge then
Err_Msg = Err_Msg & "<li>You must be at least " & strMinAge & " years old.</li>"
end if
end if
And replace it with the following:
Code:
if len(strMAge) > 0 then
if not isNumeric(strMAge) then
Err_Msg = Err_Msg & "<li>You must enter a numerical value for your age.</li>"
elseif strMinAge > 0 and strMAge < strMinAge then
Err_Msg = Err_Msg & "<li>You must be at least " & strMinAge & " years old.</li>"
end if
else
if strAge = "1" then
Err_Msg = Err_Msg & "<li>You must provide your age.</li>"
elseif strAgeDOB = "1" then
Err_Msg = Err_Msg & "<li>You must provide your birth date.</li>"
end if
end if
<

 

Replies ...


JJenson
18 January 2007, 10:20


Thanks Shaggy that will be great to have.<
JJenson
18 January 2007, 11:53


Hey shaggy is there a way we can take this one step further and maybe create a way the Super Admin can have a check box that if checked will make that field required?
I believe it s houldn't be terribly difficult but I could be wrong? smile<
Shaggy
18 January 2007, 11:56


Ay, you can if you want - I may even do it meself if I have a bit of time over the next few days - but the main purpose of this was to give people a quick & easy way to deter the spambots moreso than making those fields mandatory for all members, if you get my meaning wink
<
JJenson
18 January 2007, 11:59


Definantly I understand and is great. Just thought the added feature would be nice. I have done it manually and maybe will take a shot at doing this. Maybe I will take a shot at it and you can correct me if I am wrong? I could use the learning experiance.<
Shaggy
18 January 2007, 12:01


Ay, fire away, you know where I am if you need me smile
<
JJenson
18 January 2007, 12:02


Sounds great thanks<
Mr Pink
22 January 2007, 14:53


I'd like to use this code with the Firstname field, can somebody help me with this please.<
JJenson
22 January 2007, 14:56


Look here Mr. Pink:

http://forum.snitz.com/forum/topic.asp?TOPIC_ID=59513&SearchTerms=last,name,required

Just apply this to the first name instead of the last name.<
Mr Pink
22 January 2007, 15:20


Thanks Jeff smile<
JJenson
22 January 2007, 15:21


No problem Glad you got it working.<
jon123456
04 March 2007, 12:24


Nice and simple and implementation worked at first attempt on my new 3.4.0.6 forum - Thanks smile<
Shaggy
05 March 2007, 05:22


You're welcome.
<
KC
07 March 2007, 14:33


Just a note Shaggy... Come on man, please don't leave all that blank space on
the left in your code post. I'm running 1152x864 full screen browser and have to horizontal scroll way to many times for every text line in every post like this one even condensing screen size with Ctrl-Mouse Wheel Scroll!

Just editing it so
" <td bgcolor=""" & strPopUpTableColor & """

Just displayed in your post as
"<td bgcolor=""" & strPopUpTableColor & """
Would really help. My old eyes and hands just can't see that small text and move that much even on a 21" monitor ;-}
----------

Now about this "spam and bot registrations" thing...
If you run an NT server, an Access database, and VBscript
Put this code right below your last <!--include-->
line in your policy.asp page.

<%
if not request.servervariables("http_referer") ="" then
refer=request.servervariables("http_referer")
refer= LCase(refer)
ELSE
refer=""
end if

if left(refer,17) ="http://vales.com/" then
%>
(display the page)

You need to change the URL in this example! The refer tag simply looks where the click or direct URL entry came from.
The format is:

<%if left(refer,17) ="http://vales.com/"%>

Where in this example ="http://vales.com/" is my entire server and not a specifc site, you can do that buy extending the URL like this:

<%left(refer,32) ="http://YourSitename.com/special/

The "left(refer,NUMBER)" is the exact legnth from the Refer URL from the left you want to compare, so make sure the count matches the text. What this does is simply prevent people from using whatever page you want protected from entering from anying but a link from your site.
------

At the very bottom of the code, add this line to close it out.
<%
else
Response.Redirect "http://vales.com/problem.htm"
end if
%>
-----------
You can Response.Redirect that problem address anywhere to any page you want. But mission acomplished, if you are not clicking the link from the site you can't do squat on a protected page.


<
Shaggy
08 March 2007, 04:11


KC, that's exactly as those lines appear in the Snitz files; were I to remove the white space before posting here, those searching for the entire line by copying it from here would never find it and would be in here moaning that my instructions are wrong.
As for your mod, we used to check the referring URL to ensure people came through policy.asp before registering; however this caused no end of problems for Norton users as Norton blocks the sending of the http_referer variable for no good reason and these forums were chock full of posts from people who were frustrated that they couldn't get past policy.asp. Also, bots can easily be rewritten to land on another page in your forum and then following your registration link.
<
kolucoms6
13 January 2008, 02:38



I used the code, but somehow I cant see the DOB field..
Here is the page :

http://www.ulcindia.com/forum/register.asp?mode=Register
<
Shaggy
14 January 2008, 05:28


Do you have it turned on in your admin options?
<
forbert
23 January 2008, 15:09


This is just what's needed but, will it work on older forums, Shaggy?<
muzishun
23 January 2008, 16:39


It should work on older versions of the forum. As a side note, however, you should also look into making sure your forum is up to date with the security fixes posted on these boards. What version are you running?<
modifichicci
23 January 2008, 16:44


No because strMinAge is a value of snitz 06. It has to be adapted to old version or update to 06 version.<
muzishun
23 January 2008, 18:11


Ah, I didn't realize that. I don't actually have any older copies of the code to compare my current stuff to (mental note: get some of those). So yeah, forbert, there's your answer.
If you need help upgrading, post in the main help forums here, and we'll see what we can do to help.<
woodywyatt
10 April 2008, 12:53


I cant find the code in my register.asp file. I have 3.4.06
Any ideas?<
Shaggy
11 April 2008, 04:24


Are you sure you're looking for the right code? Only one of the changes above applies to register.asp. If that's not the problem, please post a link to a *.txt copy of your register.asp file.
<
lucapan
11 April 2008, 04:32


Originally posted by woodywyatt
I cant find the code in my register.asp file. I have 3.4.06
Any ideas?

At line 207 you will find the following code:

Code:
Err_Msg = ""

Then add the following code just after that:

Code:
''''''''''AGE / BIRTH DATE VALIDATION''''''''''
if strAge = "1" then
if len(Request.Form("Age")) > 0 then
if not isNumeric(Request.Form("Age")) then
Err_Msg = Err_Msg & "<li>You must enter a numerical value for your age.</li>"
end if
else
Err_Msg = Err_Msg & "<li>You must provide your age.</li>"
end if
end if

if strAgeDOB = "1" then
if len(Request.Form("AgeDOB")) = 0 then
Err_Msg = Err_Msg & "<li>You must provide your birth date.</li>"
end if
end if
''''''''''''''''''''''''''''''''''''''''''''''

<
Wildland
20 April 2008, 20:35


Love this mod thank you
Another one I would like to see is one that requires the first and last name to be different I get a lot of spammers who use the same for both. I have looked for one to do it but haven't came across it yet.<
Kappax
23 April 2008, 13:49


Thanks you this mod is great.<
Shaggy
24 April 2008, 04:05


You're both welcome smile
Be aware, though that the more people that make this tweak the quicker the bot authors will twig what we're doing and modify their bots to provide a date of birth.
<
AnonJr
24 April 2008, 06:31


Sadly, I've already got bots that are providing a DOB as they continue to hammer away at my church's site. The only time they've gotten through is when one (probably manned) actually validated the e-mail.<
JJRose
10 September 2008, 11:48


Hi. I am running version 3.4.06, and am trying to modify the code in your Antispam birthdate add-on mod instructions.

In your instructions you say:
"Find the following on lines 1150 and 1465 (which will become line 1471 after the first edit) of pop_profile.asp and on line 381 of register.asp:"

Unfortunately, the code you mentioned to look for doesn't appear in either of those files. (I was able to modify the "inc_profile.asp" file successfully, so that one is no problem).
The pop_profile.asp file was edited when I added the "Gatekeeper Mod", so I guess that disappeared. But the register.asp file wasn't modified and the code doesn't appear on that page either.
May I email you both of the files I have, so that you can show me where to place the correct code?
Thanks in advance.
JJRose

<
Zenfor
26 February 2012, 18:34


I'm not finding the lines you say to look for in pop_profile.asp and register.asp. Does this mean I'm not up to date and if so, how do I get up to date? Thanks!
AnonJr
02 March 2012, 09:39


Originally posted by Zenfor
...Does this mean I'm not up to date...
What version are you running? There were a few anti-spam additions to 3.4.07 (the current version), but I don't recall off the top of my head if this was one of the areas affected.
Zenfor
05 March 2012, 06:27


Originally posted by AnonJr What version are you running?
I am running version 3.4.03 based on what I see in the Forum Variables Information. I don't know how I didn't do all the updates but would like to know how to get up to date. Thanks.
AnonJr
12 March 2012, 10:15


If you do not have any MODs, download the latest code and follow the upgrade directions.
If you do have MODs, it will depend on how many and how keen you are on re-installing them from a clean 3.4.07.
© 2000-2021 Snitz™ Communications