473,549 Members | 2,727 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Intermittant Javascript Issue

2 New Member
Hi Everyone

I have very little knowledge of Javascript or any other language and have built the basics of my website using Dreamweaver. I have built in extra functions just by trying to follow the logic of other scripts etc. However, for only the second time ever, I am posting to a forum with a problem I can't can't solve. The reason I can't solve it is because the problem only happens when run the script is run more than once within a few hours of the first time?? The problem...

The 'Redirect if spambot answer wrong' section below will always return true if run more than once within a period of roughly a few hours. After which, the if statement seems to work perfectly. I appreciate it's probably not the if statement itself that is the problem but some outside factor. I created the section myself apart from declaring the MM_Flag variable which I got from another form validation section which performs a simlar function. I guess that part is evaluating if the the MM_Insert contains any data and if so, to perform the validation process otherwise...car ry on?? Is this some sort of sessions issue??

The script:

Expand|Select|Wrap|Line Numbers
  1. <%
  2. // *** Select security question
  3. var rsSecurity_cmd = Server.CreateObject ("ADODB.Command");
  4. rsSecurity_cmd.ActiveConnection = MM_database_STRING;
  5. rsSecurity_cmd.CommandText = "SELECT TOP 1 Question, Answer FROM tbl_dir_security ORDER BY NEWID()";
  6. rsSecurity_cmd.Prepared = true;
  7.  
  8. var rsSecurity = rsSecurity_cmd.Execute();
  9. var rsSecurity_numRows = 0;
  10. %>
  11.  
  12. <%
  13. // *** Redirect if spambot answer wrong
  14. var MM_flag = "MM_insert";
  15. if (String(Request(MM_flag)) != "undefined") {
  16.   var MM_dupkeySpambot_Answervalue = String(Request.Form("Spambot_Answer"));
  17.  
  18.   if (MM_dupkeySpambot_Answervalue != rsSecurity.Fields.Item("Answer").Value) {
  19.     // wrong answer
  20.     Response.Redirect("security.html");
  21.   }
  22. }
  23. %>
Any help you can offer would be very much appreciated!

Many thanks if you've read this far!

Lee
Feb 24 '09 #1
1 1107
acoder
16,027 Recognized Expert Moderator MVP
This doesn't look like a JavaScript problem. The code you've posted is ASP. Is there any JavaScript code involved?
Feb 24 '09 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

5
2199
by: Michael Mossey | last post by:
Runnng python 2.2 on HP-UX, I get intermittant slow startup. Sometimes python starts up in a small fraction of a second, and sometimes takes 3-5 seconds. This applies to any script I run, or just typing 'python' at the prompt. I also observed something similar on Linux. Any ideas what would cause *intermittant* slow startup? -Mike
0
1389
by: Nick Jushchyshyn | last post by:
Having a really strange issue with IIS 6 where the session variable does not stay consistant. The first symptom was that database connections (which use a user entered name/PW stored in the Session) in ASP pages were failing. Finally got to (what I think is) the root issue by creating two ASP pages, one that sets Session("test") = "Hello",...
2
2259
by: Chuck Ritzke | last post by:
Hi all, I am getting an intermittant error after uploading a project from my development machine. I click on a link which opens an aspx page that, upon page load, reads a very small amount of data from an MS Access database, using ODBC and a stored query. There is no problem on my development machine. On the production server though, I get...
2
1595
by: James Wallace | last post by:
I hope that someone can help me out there with this problem. I get an itermittant problem with our web page that occurs about once every 10 to 15 days where the only way to fix the problem is to bounce the web server. The error can be seen below. I have looked at the stack trace and determined where the error is occuring but when I look...
0
7450
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
7720
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
1
7470
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
7809
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
1
5368
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
5088
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3500
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
0
3481
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
1059
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.