Author |
Topic  |
Andy Humm
Average Member
  
United Kingdom
908 Posts |
Posted - 24 August 2008 : 13:55:00
|
I am currently (trying) installing the Gatekeeper Mod into the Greetings Card Mod and have so far succesfully got the Anti-Spam Question and Input answer box to work. (link)
The stumbling block I have encountered is trying to get the error routines to work, ie no answer entered or the wrong anti-spam answer.
The code I have for the greetings_card_preview is: (Green original error code and red supplied with gatekeeper mod)
I would appreciate if some advise could pinpoint why the gatekeeper error messages fail to work Thanking you in advance andy
|
|
Carefree
Advanced Member
    
Philippines
4222 Posts |
Posted - 24 August 2008 : 15:25:16
|
Post a link to the file in .txt format & we'll have a look.
BTW your question leaves a number of possible answers: 12, twelve, Twelve, XII, etc.
To preclude the more obvious ones, you could say: "What is the sum of six added to six (numerals only)?
Then force numeric replies by enclosing your case else instructions with something like this:
< |
Edited by - Carefree on 24 August 2008 15:28:42 |
 |
|
Andy Humm
Average Member
  
United Kingdom
908 Posts |
Posted - 24 August 2008 : 15:41:55
|
CF: Re: txt link, I will post link in morning, currently do not have access to files..(working night shift)
Valid point regarding the antispam question; thank you.
< |
 |
|
Jezmeister
Senior Member
   
United Kingdom
1141 Posts |
Posted - 24 August 2008 : 17:02:04
|
May seem like a stupid question but is strRegistrationGatekeeper 1? would nicely explain your problem if it's not < |
 |
|
Carefree
Advanced Member
    
Philippines
4222 Posts |
Posted - 24 August 2008 : 17:25:11
|
Yes, because the antispam form is displayed. Andy's problem lies in error and data validity logic.< |
 |
|
Andy Humm
Average Member
  
United Kingdom
908 Posts |
Posted - 25 August 2008 : 03:57:33
|
CF: Please find two files greeting_cards_preview.asp textlink greeting_cards_cat.asp textlink The alterations in greeting_cards_cat.asp start with if strLinkSpamGatekeeper = "1" then lines 309-324 The alterations in greeting_cards_preview.asp - the antispam error check are between lines 171-182 The readme file of the Gatekeeper Mod (link in first post above) explains how to incorporate the code with other sitz files. But I got stuck with this validity check here..
Thanking you in advance edit line numbers changed in reference links< |
Edited by - Andy Humm on 25 August 2008 04:36:37 |
 |
|
Andy Humm
Average Member
  
United Kingdom
908 Posts |
Posted - 25 August 2008 : 04:23:03
|
CF: I have managed to get an error message/validity check of sorts displaying in the preview page, using this code:
But if you could look at the preview page , the greeting card will send, even though the error messages are being displayed. As a way ahead or solution, could the error validity prevent the 'Send this Greeting' button from being active until there are no errors or possible not show the preview panel until all error have cleared? thanking you < |
 |
|
Carefree
Advanced Member
    
Philippines
4222 Posts |
Posted - 25 August 2008 : 05:49:31
|
Definitely, that's what data validation is all about. If you asked for an EMail address and the user typed 1600 Pennsylvania Avenue, he probably wouldn't get the EMail. So you don't want to cause a crash by attempting to insert illegal values into your database - make the burden of compliance fall on the users.< |
 |
|
Carefree
Advanced Member
    
Philippines
4222 Posts |
Posted - 25 August 2008 : 05:57:29
|
I just saw another flaw in the data validation. It checks for the presence of an @ sign in email fields, but doesn't check if there is any period or anything following a period.
So I could type humbug@christmas - and it thinks it has an EMail address.
This needs a little more work.< |
 |
|
Carefree
Advanced Member
    
Philippines
4222 Posts |
Posted - 25 August 2008 : 06:01:04
|
You have a number of lines of data validation that aren't having the effect they should. Primarily because the "send this greeting" isn't constrained by an if/then routine.
What needs to happen is to convert all of those Response.Write's to strError = strError & (new message). Then when you get to the "send this greeting", you make it conditional on strError="".< |
 |
|
Carefree
Advanced Member
    
Philippines
4222 Posts |
Posted - 25 August 2008 : 06:40:30
|
Here, Andy, try these. Your cat file was (other than cosmetic changes & the gatekeeper) very close to mine. I did have a couple of sql injection preventative measures in mine.
Here's your files: gcc gcp< |
 |
|
Andy Humm
Average Member
  
United Kingdom
908 Posts |
Posted - 25 August 2008 : 07:30:54
|
CF, Thank you for your valuable input, and as you say there are quite a few areas that need addressing, especially the data validation routine. When I first downloaded this mod, I tried to tackle some of the flaws, as you say, and got critisised for looking for changes that were not in the initial design concept. However, I have realised there are issues that do require updating and hence tried myself. I am glad you agree there are issues. I understand the data validation lines that aren't having the effect they should, ie email xxx@xxxx will carry without the xxxx.xxxxxx.xx . The reason for this gatekeeper addon as to to prevent nuisense spamming within the whole forum package from non-members of bot orientation. Thank you so far..
quote: You have a number of lines of data validation that aren't having the effect they should. Primarily because the "send this greeting" isn't constrained by an if/then routine. What needs to happen is to convert all of those Response.Write's to strError = strError & (new message). Then when you get to the "send this greeting", you make it conditional on strError="".
Is there a way to utilise an 'if/then' to check that the gatekeeper validation is true then display the rest of the preview panel like the other error message routines. I know you mentioned about converting the error to strErrors but I am out of my depth at the moment attempting, I did try, hence, the route I have taken so far.
Thank you again Andy< |
 |
|
Carefree
Advanced Member
    
Philippines
4222 Posts |
Posted - 25 August 2008 : 07:40:14
|
I converted the preview page for you already, the validation routine will now work. I also blocked two sql injection loopholes. However, I have not yet tackled the EMail issue. Those changes are in the file links I posted above.< |
 |
|
Carefree
Advanced Member
    
Philippines
4222 Posts |
Posted - 25 August 2008 : 07:56:14
|
I added in a check for your Gatekeeper - now there won't be a submit button if an error condition still exists.< |
 |
|
Andy Humm
Average Member
  
United Kingdom
908 Posts |
Posted - 25 August 2008 : 07:56:52
|
Thank you I have noted and used the changes, much appreciated,,
I was investigating the routines as we now have them, maybe if we could slot the following code (in green) into the case statements of the gatekeeper and then provided true, we can introduce the final code to show the 'Send this Greeting' button " <input type=""submit"" value=""Send this Greeting"" name=""B1"">" & vbNewLine & _
response.write "<font face=""" & strDefaultFontFace & """ size=""" & strDefaultFontSize & """>If you need to amend the details above, return back,<br> but please remember to select an image you want displayed on your greeting card <br><a href=""javascript:history.back()"">Back</a></font><br><br>" & vbNewLine &_
warmest regards andy
< |
 |
|
Andy Humm
Average Member
  
United Kingdom
908 Posts |
Posted - 25 August 2008 : 08:03:51
|
CF, that was quick, just as I have posted my reply and refreshed this thread you have kindly provided a solution to the submit button. I see the code changes but have not seen them work yet as i have the following error: Microsoft VBScript compilation error '800a03ea' Syntax error /forumtest/greeting_cards_preview.asp, line 90 elseif fromname = "" then strError = strError & "Please enter your name!<br>" ^
Did you ament these routines?< |
 |
|
Topic  |
|