Author |
Topic |
Shaggy
Support Moderator
Ireland
6780 Posts |
Posted - 18 January 2007 : 09:20:49
|
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:" <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:" <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:" <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:" <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: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: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 < |
Search is your friend “I was having a mildly paranoid day, mostly due to the fact that the mad priest lady from over the river had taken to nailing weasels to my front door again.” |
Edited by - Shaggy on 18 January 2007 09:22:04 |
|
JJenson
Advanced Member
USA
2121 Posts |
Posted - 18 January 2007 : 10:20:46
|
Thanks Shaggy that will be great to have.< |
|
|
JJenson
Advanced Member
USA
2121 Posts |
Posted - 18 January 2007 : 11:53:07
|
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? < |
|
|
Shaggy
Support Moderator
Ireland
6780 Posts |
Posted - 18 January 2007 : 11:56:35
|
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
< |
Search is your friend “I was having a mildly paranoid day, mostly due to the fact that the mad priest lady from over the river had taken to nailing weasels to my front door again.” |
|
|
JJenson
Advanced Member
USA
2121 Posts |
Posted - 18 January 2007 : 11:59:44
|
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
Support Moderator
Ireland
6780 Posts |
Posted - 18 January 2007 : 12:01:16
|
Ay, fire away, you know where I am if you need me
< |
Search is your friend “I was having a mildly paranoid day, mostly due to the fact that the mad priest lady from over the river had taken to nailing weasels to my front door again.” |
|
|
JJenson
Advanced Member
USA
2121 Posts |
Posted - 18 January 2007 : 12:02:35
|
Sounds great thanks< |
|
|
Mr Pink
Junior Member
United Kingdom
387 Posts |
Posted - 22 January 2007 : 14:53:50
|
I'd like to use this code with the Firstname field, can somebody help me with this please.< |
Martin Leyland Forum Leyland Lancashire UK |
|
|
JJenson
Advanced Member
USA
2121 Posts |
|
Mr Pink
Junior Member
United Kingdom
387 Posts |
Posted - 22 January 2007 : 15:20:05
|
Thanks Jeff < |
Martin Leyland Forum Leyland Lancashire UK |
|
|
JJenson
Advanced Member
USA
2121 Posts |
Posted - 22 January 2007 : 15:21:12
|
No problem Glad you got it working.< |
|
|
jon123456
Starting Member
United Kingdom
8 Posts |
Posted - 04 March 2007 : 12:24:56
|
Nice and simple and implementation worked at first attempt on my new 3.4.0.6 forum - Thanks < |
|
|
Shaggy
Support Moderator
Ireland
6780 Posts |
Posted - 05 March 2007 : 05:22:21
|
You're welcome.
< |
Search is your friend “I was having a mildly paranoid day, mostly due to the fact that the mad priest lady from over the river had taken to nailing weasels to my front door again.” |
|
|
KC
Junior Member
USA
152 Posts |
Posted - 07 March 2007 : 14:33:24
|
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.
< |
Owner of vales.com and Elite Computers. |
|
|
Shaggy
Support Moderator
Ireland
6780 Posts |
Posted - 08 March 2007 : 04:11:40
|
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.
< |
Search is your friend “I was having a mildly paranoid day, mostly due to the fact that the mad priest lady from over the river had taken to nailing weasels to my front door again.” |
|
|
kolucoms6
Average Member
845 Posts |
|
Topic |
|