473,382 Members | 1,583 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,382 software developers and data experts.

Ignore

Can some one tell me how to change the validation seqence for the code pased below, actually what i want it when any one enters the wrong login information (already registered users) then it has to tell then them its worng information but currently it takes then to a next page and then tells them its incorrect information. This is tedious as every time they enter wrong they will be redirected to a different page and then they have to come back and they try again its the same for registration. Pls do help i appreciate the quick help.....
Apr 3 '08 #1
1 1261
shweta123
692 Expert 512MB
Hi,

Hi,

If you want to design your page in such a way that page will not be redirected to next page when user enters a wrong Login and Password information. In that case you can show the error message on the same page.Give him the chance to try the Login maximum 3 times. After which he will be redirected to Error page.

e.g. You can try this code :

Expand|Select|Wrap|Line Numbers
  1. <%
  2.  
  3.   Dim Cnt
  4.   Dim rs
  5.   Dim con
  6.   Dim sql
  7.   Dim errorMsg 
  8.  
  9.  
  10.   Dim uname
  11.   Dim pwd
  12.  
  13.  
  14.   'Get uname and password entered by user
  15.   uname = Request.Form("uname")
  16.   pwd = Request.Form("pwd")
  17.  
  18.  
  19.   'I have declared these querystring variables for displaying error message
  20.   errorMsg = Request.QueryString("message")
  21.   Cnt = Request.QueryString("m_cnt")
  22.  
  23.   '''When the Login page will be first time displayed Cnt  is zero
  24.   If Cnt <>0 then
  25.   'Create connection
  26.  
  27.   con= Server.createObject("Adodb.Connection")
  28.   con.connectionstring ="..."
  29.   con.open
  30.  
  31.  
  32.   'Create recorset
  33.    Set rs = Server.createObject("Adodb.Recordset")     
  34.  
  35.  
  36.    'Open recordset
  37.    Sql = "Select * from LoginTable where login = '" & uname &"' and Password = '" & pwd & "'"
  38.  
  39.    set rs= con.execute(Sql)
  40.  
  41.   If not rs.eof then
  42.     'Login and password is correct
  43.  
  44.     response.redirect("Main.asp")
  45.   elseif(Cnt>3)
  46.     'User has attempted the the Login for more than 3 times so redirect to error page
  47.  
  48.     response.redirect("Error.asp")
  49.   else 
  50.      errorMsg = "error in login"
  51.      cnt=cnt+1
  52.   end if
  53.  else
  54.     cnt = 1
  55.  end if
  56.  
  57. %>
  58.  
  59.  
  60. <html>
  61. <body>
  62. <form method ="post" action = "Login.asp?m_Cnt=<%=Cnt>&errorMessage=<%=errorMessage>">
  63. <table>
  64. <tr>
  65. <td>
  66.   <!--Display error messsage on the page-->
  67.   <%=errorMessage>
  68. </td>
  69. </tr>
  70. </form>
  71. </body>
  72. </html>


Can some one tell me how to change the validation seqence for the code pased below, actually what i want it when any one enters the wrong login information (already registered users) then it has to tell then them its worng information but currently it takes then to a next page and then tells them its incorrect information. This is tedious as every time they enter wrong they will be redirected to a different page and then they have to come back and they try again its the same for registration. Pls do help i appreciate the quick help.....
Apr 4 '08 #2

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

Similar topics

0
by: Thomas Müller | last post by:
Hello! Running my uploadscript on old server, php4.1.2 ignore aborted fileuploads. Now, the same script on new server doesn't ignore broken uploads. If anybody make a upload and abort this the...
6
by: Rob Meade | last post by:
Lo all, I was just running through some code I was writing for a site and when it came to the 'exact phrase' search type I wasn't sure whether that should run through and ignore the words in the...
5
by: Luis | last post by:
Please help, this is due at 11:59 PM tonite. Thanks Write a program that reads a person's name from the keyboard in the format First Middle Last. It should then (1) print each of the names on...
1
by: Thomas Bartkus | last post by:
The meaning of REPLACE INTO is clear to me. IF the new record presents new key values, then it is inserted as a new record. IF the new record has key values that match a pre-existing record, then...
5
by: Chris Mantoulidis | last post by:
Let's say I have this: std::string s1; std::cin >> s1; This will read s1 from cin until it finds a space (or a newline, whichever comes first). Okay this works. But when I want to continue...
1
by: windandwaves | last post by:
Are you allowed to use the following syntax in Mysql 4.0.17-nt : INSERT DELAYED IGNORE INTO `mytable` ( `ID` , `A` , `B` ) VALUES ("'.session_id().'", "2", ROUND(NOW()/10000) ); I am...
23
by: FrancisC | last post by:
#include <stdio.h> int file_copy( char *oldname, char *newname ); int main() { char source, destination; printf("\nEnter source file: ");
4
by: Jackson Miller | last post by:
I notice that postgres does not support IGNORE. I am currently migrating an app from a MySQL datastore to Postgres, and I would really like to use IGNORE. I am curious if there is a...
1
by: alw0015 | last post by:
I'm working on a piece of code that reads in a time from the user. This time value consists of 3 separate inputs: 1 integer representing hours 1 char representing the ":" 1 integer...
6
by: sandy | last post by:
I seem to ALWAYS need to use cin.ignore in my programs (console apps using Dev C++ for a University course). The problem is that if I don't ignore ENOUGH characters then it's like not having the...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...

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.