After receiving a few queries about how to store passwords using ACCESS and ASP, and then use them as "logins", I thought, well, why not write in a separate article, instead of attaching multiple ASP files that are full of confusing comments and variables only to be decipherable by my brain?
I'm assuming you've installed, and are running PWS (Personal Web Server) on your machine, if you are not already working on a server that supports ASP.
First of all, create a database, for instance, customers.Define a table with all the fields you require (include email and password).
After the database has been created, you need to create a DNS in order to access this database through your ASP pages.
If you have never created it, this is how you do it:
Go to the Control Panel (My Computer -> Control Panel), and click on the icon that should be saying "ODBC Data Sources (32bit)". In the resulting window, select the "System DSN" tab. Then click on the "Add..." button. From the given list of Database drivers, select "Microsoft Access Driver (*.mdb)" and click the "Finish" button. You reach a place where you have to enter the "Data Source Name". Enter it, anything, for instance, "customers". Then click the "Select..." button. This lets you select the Access database you created. Press Ok, press Ok, and press Ok. Your DSN is created.
In the first part, I'll write about storing the passwords.
Before this, let's make an include file to create and initialize the session variables that we are going to need (we can use cookies, but some clever folks disable cookies on their browsers).
File name: sessions.inc
This file you can include in every page as
so that you can use them whenever you need them.
Now accepting login and password.
For this you require a normal HTML form. You can have "n" number of fields in a form, but here, our primary concern is, getting the email as login, and the accompanying password.
Here's the form:
Please enter your details:
Enter Email:
Enter Password:
We validate the form before it proceeds to the "action" file so that there is very little server-side processing. A simple validation:
Note: Put the following Javascript above the tag.
function validate()
{
var res=true;
allok=true;
// Checking that the email has been entered. if(document.login_info.email.value=="" || document.login_info.email.value==null) {
alert("Sorry, you cannot register without an email address.");
res=false;
allok=false;
document.login_info.email.focus(); }
// Checking that the password is right. if(allok==true)
// I'm using allok here because if allok is false, no use checking for the next field. {
if(document.login_info.pass.value.lengthFrom now onwards, whenever you want to perform some action that
should only be performed if the user is logged in, just check the value is session("email"), like:
Hope this helps. If you need further queries, or in future you need some other ASP work, you are welcome to write to me at amrit@bytesworth.com.
Amrit Hallan is a freelance web designer. For all web site development and web promotion needs, you can get in touch with him at http://www.bytesworth.com. For more such articles, visit http://www.bytesworth.com/articles and http://www.bytesworth.com/learn You can subscribe to his newsletter [BYTESWORTH REACHOUT] on Web Designing Tips & Tricks by sending a blank email at bytesworth-subscribe@topica.com
by Amrit Hallan
Asp F Bed Linen
Online Shopping Mens Casual Clothing, Man Pyjamas and Tunic Top Woman
Home Linen: A large range of Bed, Bath, Table and Kitchen linens.
SFERRA/DEA/MATOUK/PURISTS/SDH/HOME TREASURES/Deep pocket bed sheets
F & B Specialty Linen Fine
F & B Linens - Announcements
Finest european linens to table, bed and bath linens. F & B Specialty Linen. SFERRA beautiful, high thread count bed sheets. Peacock Alley designer matelasse bed linens 21" deep
Indian Bed Spread, Bedspreads, Bed Sheets, Cotton Bed Spread, Cotton
Fabindia -Bedding, Indian Bed Spread, Cotton Bed Spread, Indian Print Bed Spread Our natural fiber linens capture the best of casual cotton bedding in beautiful fabrics and
Store Information
Finest european linens to table, bed and bath linens. F & B Specialty Linen. SFERRA beautiful, high thread count bed sheets. Peacock Alley designer matelasse bed linens 21" deep
Bed linen > Egyptian cotton? - consumer.org.nz
The Consumer guide to Bed linen Egyptian cotton? True Egyptian cotton is grown along the banks of the Nile River.
Agua Fabrics :: Fire Retardant Printed Bed Linen
We supply fire retardant bed linen printed with a range of designs and colours T +44 (0)20 8205 0050 - F +44 (0)20 8205 0660 Email: Info@aguafabrics.com
Clearance/ Display Iron Beds - Iron Beds, Brass Beds, Fine Linens
Baby Linens: Bags & Purses: Bath Towels & Body: Bedding Ensembles: Bedskirts: Blankets & Throws: Brass Beds: Children & Teens: Clearance: Clearance/ Display Iron Beds
Agua Fabrics :: Poly Cotton Bed Linen
Poly Cotton Bed Linen T +44 (0)20 8205 0050 - F +44 (0)20 8205 0660 Email: Info@aguafabrics.com
Clearance/ Display Iron Beds - Iron Beds, Brass Beds, Fine Linens
Save 10% on your first Order. *Excludes Anichini, Ann Gish, Sferra and Iron & Brass Beds : Receive updates on the latest offers and events.
MLB Cleveland Indians from Biederlack at American Bed Linens
Cleveland Indians Body Pillow (F) 19 x 54: 22.89: 19.99 American Bed Linens Toll Free: 800 246-7451 Phone: 949 716-0760 Fax: 949-716-2206
USA Shopping Club - Categories in "BED LINENS"
Customer Service; F.A.Q. BED AND BATH > BED LINENS
Bed Linens Resources for Wedding Favors
Bed Linens Resources for Wedding Favors, Bed Linens Wedding Favors Add URL Bomboniere L'Angioletto - Elegantly boxed giftware and wedding f - beautiful favors
Linensource ? Bed linens, luxury bed sheets, bedspreads, quilts and
Bed Skirts and Accessories; Comforters - Down and Down Alternative; Cuddlebed Mattress Toppers Quilted Bedspreads; Quilts by C&F; Solids; Stripes and Plaids; Williamsburg |
Susan Fredman At Home - Getaway with Style, Linger in Luxury
Bed Linens; Blankets and Throws; Clocks; Decorative Mirrors; Fabrics; Furniture; Lighting At Home with Nature Custom Eurosham Starting at $245.00