Programming Tutorials Browser Tutorials Articles Struts Tutorials Hibernate Tutorials

Search: 

  Tutorial: ASP Security Login page in ASP through Access DB Tutorial

You will find here a sample script showing you how you can protect a reserved area of your website with a simple login page. The script is using an access sample database.

Tutorial Details:

Application ASP

Techniques / Application ASP

How to protect a site by a password and a login

In the majority of the Web applications, there is today a reserved access protected by a password and a login. This authentification can allow for example the possibility to the user authenticated to download documents, or to have the possibility of poster of information on a forum.

There are several methods to arrive at this result. We will leave on simple bases, to be able to authenticate a user we will need a form where this one will inform are login and its password.

The page containing the form will be "login.asp" and it will be sent it even the data of the form.

After having to recover those we will use a Access base in order to check that the couple login/password is quite existing. If the user does not exist or if its password does not correspond it will not have the right of access and we will post an error message. If not we will be able to redirect it towards the part protected from the site or to post the information to him which we want hidden with the unknown ones.

In the example according to a data base named "login.mdb" is created. It has the table "users" of which here description:

id_user
name
login
password

<%
'Login.asp web page

'Declaration of variables
Dim Con
Dim rstLogin
Dim strSQL

Dim login
Dim password

'If the webpage receive vars from the form:
login = Replace(Request.Form("login"), "'", "''")
password = Replace(Request.Form("password"), "'", "''")

%>
<html>
<head><title>Login Page</title>
</head>
<body bgcolor="gray">
<%

'If this page don't receive var posted by the form
If Request.Form("validate") <> "GO" Then
%>
<form action="login.asp" method="post">
<table border="0">
<tr>
<td align="right">Login:</td>
<td><input type="text" name="login"></td>
</tr>
<tr>
<td align="right">Password:</td>
<td>
<input type="password" name="password">
</td>
</tr>
<tr>
<td align="right"></TD>
<td>
<input name='validate' type="submit" VALUE="GO">
</td>
</tr>
</table>
</form>
<%
Else
sql = "SELECT * FROM users " _
& "WHERE login = '" & login & "' " _
& "AND password ='" & password & "';"

Set Con = Server.CreateObject("ADODB.Connection")
Con.Open("DRIVER={Microsoft Access Driver (*.mdb)};" _
& "DBQ=" & Server.MapPath("login.mdb"))

Set rstLogin = Con.Execute(sql)

If Not rstLogin.EOF Then

'here we can redirect the authentified user
Response.redirect "secure_page.asp"

Else
%>
<p>
<font size="4" face="arial,helvetica"><b>

Logion error !
</b></font>
</p>
<p>
<a href="login.asp">Réessayer</a>
</p>
<%

'we stop here the page
Response.End
End If

' Clean Up
rstLogin.Close
Set rstLogin = Nothing
cnnLogin.Close
Set cnnLogin = Nothing
End If
%>
</body>
</html>


 

Read Tutorial at: Click here to view the tutorial

Rate Tutorial:
ASP Security Login page in ASP through Access DB Tutorial

View Tutorial:
ASP Security Login page in ASP through Access DB Tutorial

Related Tutorials:

Displaying 1 - 50 of about 3584 Related Tutorials.

VB and ASP programmers
VB and ASP programmers VB and ASP programmers...;  Position Vacant: VB and ASP programmers  Job Description  Visual basic programmer with ASP knowledge to develop
 
Login Form
; Login form in struts: Whenever you goes to access data from database, as a register user you are always asked for the login... Login Form,Struts Login Form Login Form
 
RichFaces: Login & Registration Application:
increases the responsiveness of the application. In this application, Login page...; in the login page itself. User is asked for the email id, which if valid and registered... - Login & Registration Application RichFaces: Login &
 
RichFaces: Login & Registration Application
increases the responsiveness of the application. In this application, Login page...; in the login page itself. User is asked for the email id, which if valid and registered... - Login & Registration Application RichFaces: Login &
 
Access all the fields from table through JSP
Access all the fields from table through JSP Access all the fields from table through JSP   .... This is first jsp page that has a link 'show data from table', which displays
 
PHP SQL Login
; This Application illustrates how to create a login page where only authorized user can login and process further. In this application, we have created a userlogin.php... PHP SQL Login PHP SQL Login  
 
Login Application
; This tutorial provides some simple steps for creating a website login application... Login Application,Struts Login Application,Hibernate Login Application,Hiberate Login Login Application  
 
DB Schema Viewer
DB Schema Viewer DB Schema Viewer...; DB Schema Viewer is an Eclipse plugin that builds a graphical view of an existing database. Reverse Engineering is performed through JDBC. The most
 
J2EE Tutorial - Introduction
J2EE Tutorial - Introduction J2EE Tutorial... want to know whether J2EE is Java atall or something else. This tutorial... with a lot of new features and jdk1.5 is expected shortly. Moreover, Security
 
Creating Login Page In JSF using NetBeans
Creating Login Page In JSF using NetBeans, NetBeans JSF Tutorial, JSF Using NetBeans Creating Login Page In JSF using NetBeans... a login form in JSF using NetBeans. To create the jsp page in NetBeans: 1. Right
 
Tips: WiFi Security for Home Networks
Tips: WiFi Security for Home Networks Tips: WiFi Security for Home Networks        ...;      Introduction Security is a huge
 
MySQL Tutorial - SQL Tutorials
to understand how it handles access privileges, passwords, and security.  ... MySQL Tutorial,Free MySQL Tutorials,MySQL Programming Tutorials,Online MySQL Help for Beginners MySQL Tutorial - SQL Tutorials
 
JSF Simple Login Application
a complete login application in the JSF Tutorial section to teach you JSF..., you can enter in your application by using the login page. For running your... JSF Simple Login Application JSF Simple Login
 
Wi-Fi Security for Public Networks
Wi-Fi Security for Public Networks Wi-Fi Security... set of security problems, quite different from the security issues involved... filtering to enable hassle free access to all users. Even if a public hotspot
 
Login and User Registration Application
; In this tutorial we will learn how to develop login application based on Struts... This tutorial provides some simple steps for creating a website login application... Struts Hibernate Spring,Login and User Registration Application
 
Java Security
Java Security - Java Security Package Java Security Java Security Packages JCA/JCE ( an outline) In this tutorial, the author explains
 
Struts 2 Login Application
of the application Login page is displayed to take the input. User enters user name... and easy steps to develop Login page in the using Struts 2 framework. Develop... to display the login page to the user. In our application it is saved in "
 
Jdbc access database
Jdbc access database Jdbc access database... connections.  Understand with Example In this Tutorial we want to describe you a code that helps in understanding JDBC access database. The code illustrates
 
JSF Tutorial for Beginners
JSF TUTORIAL - INTRODUCING   JAVA  SERVER  FACES... the transition phase.   In this three  part  tutorial... with JSF and getting the best of both worlds. ( As this tutorial presumes
 
DB Visual Architect for Eclipse
DB Visual Architect for Eclipse DB Visual Architect...;      Extensive Database Coverage DB Visual... Now developers and DB administrators can create diagrams much faster than any
 
PHP SQL Login Script
PHP SQL Login Script PHP SQL Login Script... for login application. In this example, we have created a login application where we... or password then the error message is displayed in the next page. If user passes
 
Struts 2 Tutorial
Programming Tutorials Struts 2 Tutorial  ... Struts 2 Tutorial and Online free training helps you learn new elegant Struts 2...;        Struts 2 Login Application
 
Struts 2 Tutorial
Programming Tutorials Struts 2 Tutorial  ... Struts 2 Tutorial and Online free training helps you learn new elegant Struts 2...;        Struts 2 Login Application
 
VoIP Security
VoIP Security VoIP Security   ...; VoIP Overlook Security Corporations that are implementing voice over IP... the security risks that can crop up when the voice and data worlds converge, users
 
Integrating Login And Registration Application In JSF
;  This tutorial explains integration of login....   This page appears when the user is not permitted to login... Integrating Login And Registration Application In JSF
 
Login form
example of login form will really help to understand jsp page. In this  example we will create a simple dynamic JSP page that prints the user information... Create Login Form with jsp Login Form with jsp
 
Security Issues with the Applet
Security Issues with the Applet Security Issues... deemed trustworthy by the end user. The security restriction is provided... security issues to applet are following : Applets are loaded over
 
Linux Firewall
its own users have to access to. Firewall acts as a gateway through which all... to prevent some unauthorized Internet access from a private network prohibited by the security policy. It is  generally used to protect data from one network from
 
Accessing Database from servlets through JDBC!
Accessing Database from servlets through JDBC! Accessing Access Database From Servlet     ... how to access database from servlets. Here I am assuming that you
 
Simplest Login and Logout example in JSP
in this tutorial we are create application takes an user login from that having user...; The above login page prompts the user to enter his or her name... Tomcat Quick Start Guide Simplest Login and Logout
 
Login Authentication using Bean and Servlet In JSP
login Authentication using Bean and Servlet In JSP Login Authentication using Bean and Servlet In JSP  ...; In this section, we have developed a web application of login authentication using
 
Struts 2 Tutorials for Beginners, Struts 2 Tutorial
Programming Tutorials Struts 2 Tutorial  ... Struts 2 Tutorial and Online free training helps you learn new elegant Struts 2...;        Struts 2 Login Application
 
Security and Privacy Issues in Location Based Service (LBS)
Security and Privacy Issues in Location Based Service (LBS) Security and Privacy Issues in Location Based Service (LBS... through common cellular network or radio stations. Till now it has left a wide
 
MySQL Access Control
; MySQL Security Access Control Most users concentrate on MySQL's databases... discussion of security issues with the MySQL access privilege system... MySQL Access Control MySQL Access Control  
 
Welcome to the Apache Struts Tutorial
- Jakarta Struts Tutorial Struts1 Examples Struts 2 Training! Get... in this tutorial. Struts1 vs Struts2 Struts2 is more powerful... to create user interface form using struts ActionFrom class and jsp page
 
Create dynamic page through JSP
How to read text file in Servlets Create dynamic page through JSP      ... that shows how to create dynamic page. This code shows one by one record of student
 
Beginners Java Tutorial
;      Access Static Member Of The Class Through... java Beginner,java Beginners,Beginning java,Beginners Java Tutorial,Java for beginners Beginners Java Tutorial
 
iPhone Security and Safety Tips
it. iPhone Passcode Security Tips: Okay setting an access Passcode is elementary... iPhone 3G Security Tips, Guide | iPhone Safety Tips iPhone Security and Safety Tips    
 
Access URL
Access URL Access URL...; This example is used to access the data from the specific url. The Stream Connection... then it return to launch page, but if user click on 'Yes' button then it check
 
Beginners Java Tutorial
;      Access Static Member Of The Class Through... java Beginner,java Beginners,Beginning java,Beginners Java Tutorial,Java for beginners Beginners Java Tutorial
 
J2ME Tutorial
J2me Tutorial J2ME Tutorial  ...;    Creating MIDlet Application For Login in J2ME This example show to create the MIDlet application for user login . All MIDlet
 
J2ME Tutorial
J2me Tutorial J2ME Tutorial  ...;    Creating MIDlet Application For Login in J2ME This example show to create the MIDlet application for user login . All MIDlet
 
Small Business Computer Security, the Basics
Small Business Computer Security, the Basics Small Business Computer Security, the Basics... or areas of security that could be discussed, but I am going to try and focus
 
Access Static Member Of The Class Through Object
Access Static Member Of The Class Through Object Access Static Member Of The Class Through Object   ... static variables. The following example shows both ways to access static method
 
Thread Access through the Hash Table in Java
Thread Access through the Hash Table in Java Thread Access through the Hash Table in Java                  
 
Setting and Getting Data in jsp through the Session
Setting and Getting Data in jsp through the Session Setting and Getting Data in jsp through the Session  ... in jsp. By this example you can easily learn how we can get data from one page
 
Servlet to authenticate user
Create Login Form with jsp Servlet to Authenticate...;   For security everyone want to restrict the unauthenticated user for access the web site. Now in this example there is a common way
 
Privacy and Security Issues in BI
Privacy and Security Issues in BI GPS Capability,GPS Capabilities Privacy and Security Issues in BI  ...; WITH THE GROWTH of Business Intelligence market, the privacy and security issues
 
Using Protected Access in JSP
Using Protected Access in JSP Using Protected Access in JSP         ... of access specifiers: public, protected, private. We always declare access specifiers
 
Login/Logout With Session
;/html> The "Success.jsp" page displays the Login... authentication. If you click the "Logout" then again login page is displayed...: Run this application by getting the login page: Enter the wrong user
 
Site navigation
 

 

Send your comments, Suggestions or Queries regarding this site at roseindia_net@yahoo.com.

Copyright © 2006. All rights reserved.