Important alert: (current site time 7/15/2013 10:07:26 PM EDT)
 

winzip icon

ASP Login and registration page. Uses database

Email
Submitted on: 2/9/2002 2:21:56 PM
By: Willem Bult  
Level: Beginner
User Rating: By 94 Users
Compatibility: ASP (Active Server Pages)
Views: 176737
author picture
(About the author)
 
     My first ASP project: a login page. It uses a database to verify usernames and passwords. Also includes registration ability. Comment is supplied so that less experienced programmers can also understand the code. PLEASE VOTE IF YOU LIKE THIS CODE!

 
winzip iconDownload code

Note: Due to the size or complexity of this submission, the author has submitted it as a .zip file to shorten your download time. Afterdownloading it, you will need a program like Winzip to decompress it.Virus note:All files are scanned once-a-day by Planet Source Code for viruses, but new viruses come out every day, so no prevention program can catch 100% of them. For your own safety, please:
  1. Re-scan downloaded files using your personal virus checker before using it.
  2. NEVER, EVER run compiled files (.exe's, .ocx's, .dll's etc.)--only run source code.

If you don't have a virus scanner, you can get one at many places on the net including:McAfee.com

 
Terms of Agreement:   
By using this code, you agree to the following terms...   
  1. You may use this code in your own programs (and may compile it into a program and distribute it in compiled format for languages that allow it) freely and with no charge.
  2. You MAY NOT redistribute this code (for example to a web site) without written permission from the original author. Failure to do so is a violation of copyright laws.   
  3. You may link to this code from another website, but ONLY if it is not wrapped in a frame. 
  4. You will abide by any additional copyright restrictions which the author may have placed in the code or code's description.


Other 3 submission(s) by this author

 


Report Bad Submission
Use this form to tell us if this entry should be deleted (i.e contains no code, is a virus, etc.).
This submission should be removed because:

Your Vote

What do you think of this code (in the Beginner category)?
(The code with your highest vote will win this month's coding contest!)
Excellent  Good  Average  Below Average  Poor (See voting log ...)
 

Other User Comments

3/1/2002 5:22:14 AMelTurcin

nice example...u could write this shorter but it's still nice...4 globes from me
(If this comment was disrespectful, please report it.)

 
3/28/2002 9:16:42 AMUser!

Hi. I love the idea for this code, and I really want to use it. However, when I open it in FrontPage, there is not preview..any clues?
(If this comment was disrespectful, please report it.)

 
6/22/2002 9:21:33 PMDavid Rodriguez

Fantastic, five globes.
(If this comment was disrespectful, please report it.)

 
6/27/2002 4:39:11 AMPeter

Well done!
(If this comment was disrespectful, please report it.)

 
8/11/2002 10:03:53 PMm@tter

Looks like the top rated code in this section. I'll definitely check it out.!
(If this comment was disrespectful, please report it.)

 
10/6/2002 6:04:37 AM

I downloaded it and used it in IIS. I left all the files in a folder in exactly the same way as it was zipped, however, on line 29 of create.asp, it says the database or object is read only. Any idea how to fix this?
(If this comment was disrespectful, please report it.)

 
11/7/2002 8:14:37 PM

Hey,

My name is Romeo and I'm a Dirty Pop/R&B/Rap/Rock male artist and I'm trying to make a Fan Club where people can register and login... can you please tell me step by step how to install your register/login ASP please...
(If this comment was disrespectful, please report it.)

 
11/14/2002 3:43:11 PM

Great script. elTurcin was right with the length of the scripts. Yet, for a first try, i'm quite impressed.
(If this comment was disrespectful, please report it.)

 
11/27/2002 3:39:48 AM

i'm very new in asp code..so
(If this comment was disrespectful, please report it.)

 
12/9/2002 6:20:59 PM

Hi. I love the idea for this code,
but im rely new to asp - wher do i add the link for the html after the create an acount and loog in? thanks

(If this comment was disrespectful, please report it.)

 
12/11/2002 4:25:34 AM

very nice code.

But i want a new user send him to a personal page where only he can acces to.

How can i fix that??
so more users and all to a different page.
(If this comment was disrespectful, please report it.)

 
12/20/2002 3:18:23 AM

hi, when i upload all files in the sever directory
(If this comment was disrespectful, please report it.)

 
12/20/2002 3:22:58 AM

hi, would you please tell me ,after i upload all file in server, i register the form, and submit it, it say create.asp and with blank, asl so the same as the login, when i submit it" it say "verify.asp with a blank page load



(If this comment was disrespectful, please report it.)

 
1/9/2003 2:28:42 PM

I enjoyed the ASP scripts. They worked perfect as promised.
(If this comment was disrespectful, please report it.)

 
2/4/2003 11:05:49 PM

Good work. I have just vote and tried out your code, it work pretty good except it allows me to go to default.asp after i logout. I understand that you have clear the name in the session and checking on default.asp if user is login, but why it still access after logout ?
(If this comment was disrespectful, please report it.)

 
3/2/2003 7:03:30 PM

My name is Keith and I'm a
Startup Webmaster and
I'm trying to make a Buy and Sell page for my area where people have to register and login to gain access... can
you please tell me step by step how to
install your register/login ASP
please...
email me at thewolf19xx@sympatico.ca
(If this comment was disrespectful, please report it.)

 
4/10/2003 1:51:15 PM

THX!!!!
(If this comment was disrespectful, please report it.)

 
4/19/2003 3:06:29 PM

Hey author.
Its a great code - many have been telling me it works.
But I am unable to set it up as i am a novice. Could you help me? give me a tutorial or instructions - e-mail me at daft_walnut@hotmail.com
All help greatfully received.

Thx again
(If this comment was disrespectful, please report it.)

 
5/2/2003 8:06:47 PM

hi, i downloaded your code, buti cant seem to get it to work. it wont connect to the .mdb file. can u please help me to get this to work? maybe write a tutorial on how to install it? i am using IIS. plz email me back @ daman1452@aol.com
thanks.
(If this comment was disrespectful, please report it.)

 
5/15/2003 4:44:48 PM

Hi, I like your script. But when I try to registrate an error comes up.
--------
Cannot update. Database or object is read-only.

/terror/login/create.asp, line 29
--------

But im sure it has te rights to write
pz help me at meijermattie@hotmail.com

Allready thnx
(If this comment was disrespectful, please report it.)

 
5/30/2003 8:13:06 AM

You code seems to work fine, I can pull up the login page, but when I try to either register a new username, or I try to use a username that I create previously in the Db, I get this error.
ADODB.Connection.1 error '80004005'

SQLState: IM002
Native Error Code: 0
[INTERSOLV][ODBC lib] Data source name not found and no default driver specified


/verify.asp, line 8
I would appreciate any help you can give me. My email is nchusker10@hotmail.com
(If this comment was disrespectful, please report it.)

 
6/3/2003 2:13:28 PM

We are having the same problem about the create page. When creating new user, with everything valid, it comes up as if the url does not exist. Please email ajones14@moderndukes.com if you can help. Thank you.
(If this comment was disrespectful, please report it.)

 
6/21/2003 6:07:57 PM

Hi, Thank you for your good script. If you can help me for following problem, please email me at nisamkt@yahoo.com I've added more inquiry user's info in registration form and modified creat.asp file. But it doesn't work.

(If this comment was disrespectful, please report it.)

 
6/21/2003 6:15:03 PM

Below is the modified code.
<%
Username = Request.Form("txtUsername")
Password = Request.Form("txtPassword")
FirstName = Request.Form("txtFirstName")
LastName = Request.Form("txtLastName")
Address = Request.Form("txtAddress")
City = Request.Form("txtCity")
State = Request.Form("txtState")
Zip = Request.Form("numZip")

'Check if username and password are entered and set connection
--- code is the same------

'Open all records
rs.Open "SELECT * FROM userlist", conn, 1 ,3

'Check if username doesn't already exist
---code is the same---

'Add a record
rs.AddNew

rs("username")=Username
rs("password")=Password
rs("fir stname")=FirstName
rs("lastname")
= LastName
rs("address") = Address
rs("city") = City
rs("state") = State
rs("zip") = Zip

'all below code is the same as yours

(If this comment was disrespectful, please report it.)

 
7/22/2003 8:20:46 PM

Hello, Do you have step by step instructions on how to use this code?...I am a beginner, using Dreamweaver 4 and FrontPage 2000 (I like Dreamweaver better) I can insert code...but where and how?...also, what do I do at the server side? I want to use a login for a site with password protected info. Thank You.
(If this comment was disrespectful, please report it.)

 
8/22/2003 11:44:51 PM

I'm a novice with asp files and the such -- Can someone email me with how to set this all up?
My email is: kcantoinette@msn.com

~Thanks in advance
(If this comment was disrespectful, please report it.)

 
10/7/2003 8:40:52 PM

I tried to run your code and everything seemed to work fine except I am not able to register new users. It takes me to a non-working page each time I try. Do you know what the problem is?
(If this comment was disrespectful, please report it.)

 
12/1/2003 9:20:59 PM

nice code...works perfectly well for me. i'm new to this asp thing and i understand your code well...thanks..
(If this comment was disrespectful, please report it.)

 
1/8/2004 11:53:17 AM

very like you login source code...coz very simple and nice...thank u.
(If this comment was disrespectful, please report it.)

 
1/26/2004 11:15:13 AMLiam Ingram

I cant get the create.asp code to work, i think ive set read only on the db to off(in the file properties) , but it still dont work, could you please help
(If this comment was disrespectful, please report it.)

 
1/28/2004 12:09:33 AM

its really a big help in my thesis, the codes is simple
(If this comment was disrespectful, please report it.)

 
2/4/2004 6:06:00 AMKASESNIK

Really great code and easy to use BUT the create.asp page keeps going to a non-working page. Seems everyone has this problem. What is the fix for this problem?
(If this comment was disrespectful, please report it.)

 
2/4/2004 6:25:12 AMKASESNIK

Seems everyone has problem with create.asp. Author is not responding to email so please can anyone email me at kasesnik@hotmail.com with a solution.

(If this comment was disrespectful, please report it.)

 
9/2/2004 11:37:23 PM

Please tell me step by step i've already tried to set another basic ASP script from Microsoft, and ASP is enabled on my server but can't seem to get it to work...that why im trying this code any help???? Please...
(If this comment was disrespectful, please report it.)

 
9/2/2004 11:39:29 PM

Sorry forgot the E-Mail only_in_the_matrix@yahoo.com
(If this comment was disrespectful, please report it.)

 
11/7/2004 1:04:26 PM

I downloaded it and used it in IIS. I
left all the files in a folder in
exactly the same way as it was zipped,
however, on line 29 of create.asp, it
says the database or object is read
only. How can I fix this?

(If this comment was disrespectful, please report it.)

 
11/12/2004 12:58:22 PMAndrew Vos

geeez ppl just want things from you, run and hide dude, run and hide! (o well done there)
(If this comment was disrespectful, please report it.)

 
12/2/2004 2:01:44 PM

Never had a chance to try this piece out yet, I have it downloaded and am installing the services needed for ASP to run. Will get back to you!
(If this comment was disrespectful, please report it.)

 
2/21/2005 2:39:35 AM

on line 29 of create.asp, it
says the database or object is read
only. Any idea how to fix this?
(If this comment was disrespectful, please report it.)

 
3/25/2005 12:27:36 PM

i can create a new user, but when i go to login, this error comes up:

(If this comment was disrespectful, please report it.)

 
8/11/2005 4:29:42 AMSteve

Great Code. The solution to the create.asp problem that everybody is having can be found at
http://imar.spaanjaars.com/QuickDocID.aspx?QUICKDOC=263
This site has one of the easiest-to-understand explanations for how to solve a programming problem that I've ever found.
(If this comment was disrespectful, please report it.)

 
9/11/2005 6:00:48 PMaaron

hi i am just wondering i am new to al, of this asp and php i downloaded the login scripted file mate so please how do you add it to html so i can see if it works please
(If this comment was disrespectful, please report it.)

 
9/29/2005 11:29:24 AMaaron

hi does anyone know the code on how to add this scipt inside my html so i can view it on the web please thankyou
(If this comment was disrespectful, please report it.)

 
12/27/2005 12:44:27 PMFamous

How do you add impliment this code onto a web page so tht it works correctly? I use Dreamwever MX.
(If this comment was disrespectful, please report it.)

 
2/5/2006 9:30:42 AMDes

Fantastic script, it's been a while since I was coding but one I got my head round it brilliant
(If this comment was disrespectful, please report it.)

 
2/15/2006 1:17:49 AMmurtaza.m.nagarwala

i want the verify.asp page which is missing in your tutor named login and registration form.
(If this comment was disrespectful, please report it.)

 
6/1/2006 5:56:51 PMDustin

This script is awesome, took me long enough to find it but it works great. But I do have one problem that you might be able to clear up. When I use the login i have to enter the username and password twice. The first time I do it, the page just comes back and the fields are empty, the second time I do it it grants me access to the site.
(If this comment was disrespectful, please report it.)

 
7/7/2006 6:16:10 AMPb

Excellent code! came in really handy thanks, as for anyone who is having problems getting the create.asp to work try this code on this page to add on top of the create.asp from http://support.microsoft.com/default.aspx/kb/311766 , you may need to change the mdb file from read only.
(If this comment was disrespectful, please report it.)

 
7/18/2006 10:40:37 AMvino

hei ur coding really help me.can i knw hw to do if incase the customer forget their password and want to retrieve the password.may i knw how to do this.plz help me.i still new to ASP
(If this comment was disrespectful, please report it.)

 
7/31/2006 11:51:02 AMMan

NICE
(If this comment was disrespectful, please report it.)

 
8/23/2006 8:44:53 AMJamie

Hello -

I really like the look and feel of this login feature. I have downloaded the code into dreamweaver and would like to tie it into our website.

What is the best way to attach to a page on the website that we would like protected? Thanks, I'm new to ASP.

Jamie

(If this comment was disrespectful, please report it.)

 
11/17/2006 9:58:22 PMWayne & Carr Barron

To "Jamie" and all others, if you want to use this code to protect your pages. Use the code that is located in the default.asp page.
It will check if the user is logged in aginst the database and the UserSession.

Take Care
Wayne Barron
(If this comment was disrespectful, please report it.)

 
1/28/2007 11:52:37 AMdana

I have looked at the code and am new to code.
I don't know where to put it in the page and also would like to change UID to email address to capture their address as well and include their name. Can someone please tell me how to do this?
How does the info go to Access database?
(If this comment was disrespectful, please report it.)

 
2/27/2007 9:46:05 PMmckoko

wow, thanks to all programmer, it help me a lot,
(If this comment was disrespectful, please report it.)

 
4/3/2007 7:16:58 AMsandeep

you r great keep working with asp
the great login form
try to use md5 encryption for security
contact if any help needed
(If this comment was disrespectful, please report it.)

 
8/23/2007 12:24:55 AMFuzo

Hello, Do you have step by step instructions on how to use this code?

Regards
(If this comment was disrespectful, please report it.)

 
1/7/2008 9:37:04 AMraz

how do i use this code.....i want to add it to my website so i can let users log in or register?? i really need this can any1 help??
(If this comment was disrespectful, please report it.)

 
9/12/2008 2:46:29 PMDaniel

The login works well but the register user wont work. Anyone know why???
(If this comment was disrespectful, please report it.)

 
10/28/2008 6:00:16 AMAnn-marie

wow, I looked allover for a simple Login code and this sure does help, I do have a few minor hitches if you could contact me as I am trying to develop a major site.. thanks
(If this comment was disrespectful, please report it.)

 
12/11/2008 9:06:55 AMJason

this works great, but I have a question. How would I go about making the user when they create an account have them enter the password twice and then verifying that the two passwords that they entered work exactly the same.
(If this comment was disrespectful, please report it.)

 
12/31/2008 6:18:18 PMLorelle

Thank you for sharing,.. this is exactly what i have been looking for. My only concern is I'm using FrontPage 2003 and when I preview the files in the preview pane the pages are blank. Is this normal, will it all show up once the site is actually published? Please assist as I am a true Newbie to all of this. Many thanks to you in advance!!!
(If this comment was disrespectful, please report it.)

 
8/2/2009 8:10:45 PMDavid

Does anyone know how to make the account creation portion work? the verifying of users seems to work but if they dont have an account and they click on register, that portion does not seem to create the new user within the database.
(If this comment was disrespectful, please report it.)

 

Add Your Feedback
Your feedback will be posted below and an email sent to the author. Please remember that the author was kind enough to share this with you, so any criticisms must be stated politely, or they will be deleted. (For feedback not related to this particular code, please click here instead.)
 

To post feedback, first please login.