Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to create password protection for site

Status
Not open for further replies.

FireDesigner

Technical User
May 5, 2002
11
US
I am fairly new to using dreamweaver ultra dev. I am curretnly working on a site and would like to make a portion of it password protected. I read documents on how to do it with a data base of users, but I would like to make it so there is only a single username and password. Is there a way to insert something into the code instead of creating a database? Any help would be greatly appreciated.
 
In my opinion it's not a good idea to hard-code the username and password into your asp page. If the code can be seen (by viewing the source, or forcing an error) the access to your site could be compromised.
The last system I worked on, we used an asp page calling a VB MTS component to authenticate users against a SQL Server "System Access" database. If listed in this database for the particular system they were trying to access, the user is then confirmed by checking the password within the actual target system database. With the site wrapped in SSL this seems fairly secure (after 6 months of being live).
 
One Login page with formfields of

formName
formPassword

pass these variables to login.asp

IF formName = "loginName" AND formPassword = "loginPassword" THEN
Session("Loggedin") = "true"
Response.Redirect = SecurePage.asp
Else
Response.Redirect = NoAccess.htm
END IF

SecurePage.asp needs

IF Session(&quot;Loggedin&quot;) <> &quot;true&quot; THEN
Response.Redirect = NoAccess.htm
END IF

Rest of html code here The secret of life is honesty and fair dealing. If you can fake that, you've got it made.
Groucho Marx (1895-1977)
 
Depending on how secure you need the site, I go along with the previous statement about hardcoding. My suggestion would be to read Chapter 21 - Security with ColdFusion in the Macromedia ColdFusion 5 Web Application Construction Kit that's available from Macromedia Press (it's the really really big blue and white book in computer section of the bookstore). Scott Neth
Web Designer/Cyberpunk
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top