See Answers Inline
ANS: Create a table to hold the username, password, security level to the
customer. Create a login form that captures the clients username and
password they typed in. It is easiest if you use the clients Account ID as
the Username as you can then use that to filter the appropriate records.
Using a query and ASP compare the typed in info with the database info along
with the securitylevel. The security level is a way to prevent the pages
from being viewed by anyone other than a client. If all match the client
then can view the table of contents.
ANS: You will pass the username/password to each web page and check the
securitylevel at each page. For example, I have created an online request
for Courier clients to request pickup/deliveries. They log on using the
username/password assigned, which checks to see if their securitylevel
matches the setting in the page. If so, they get to the table of contents.
When they request to place an order, the Order web page again checks for the
security level and retrieves the data for that client based on his login
info. The username in this case matches the AccountId of the Client. Thus a
client can never see any other clients info. The updating of username,
passwords, and security level are done through Access, which in turns
updates the website database. Thus all control is done locally.
Step by Step may be to indepth for this forum. However, I will post the two
security ASP pages I use, minus any specific client detail that should get
you started. You can also search the internet for code.
--------------------------------------------------------
//<securitylogin.asp>
-------------------------------------------------------
<!DOCTYPE html Public "-//W3C//DTD XHTML 1.0 Transitional//EN"
"
http://www.w3.org/TR/xhtml1/xhtml1-transitional.dtd">
<%@ language=vbscript%>
<html>
<head><title>Web Order Login</title></head>
<body>
<p align="center><font class=spfont>"Online Orders Can Only Be Placed Mon
thru Fri 7am - 7pm"</font>
</p>
<form action="securityloginrespond.asp" method="post" name="frmdefault">
<table class=border align=center width=30%>
<tr>
<td>
<p class=spfont>User Name</p>
</td>
<td><input name="searchaccount"> </strong></font>
</td>
</tr>
<tr>
<td>
<p class=spfont>Password</p>
</td>
<td><input type="password" name="accountpassword"></td></tr>
<tr><td colspan=2 width="544"><font face=arial> </font><font color=navy
face=arial size=2></font> </td>
</tr>
<tr>
<td colspan=2 width="544" align="center"><input type=submit name=btnsubmit
value=submit>
<input type=reset name=reset value=reset></td>
</table>
</form>
</body>
-------------------------------------------------------
//<securityloginrespond.asp>
-------------------------------------------------------
<%@ Language=VBScript %>
<% Response.Buffer = true%>
<HTML>
<HEAD>
<TITLE>Security Login Verification</TITLE>
</HEAD>
<BODY>
<%
Dim conntemp
Dim rstemp
myname=CStr(Request.Form("SearchAccount"))
mypassword=Cstr(Request.Form("AccountPassword"))
set conntemp=Server.CreateObject ("ADODB.Connection")
conntemp.Provider = "Microsoft.Jet.OLEDB.4.0"
conntemp.ConnectionString = "Data Source=" & Server.MapPath ("\path to
database and database.mdb")
conntemp.open
set rstemp = Server.CreateObject ("ADODB.Recordset")
sqltemp="SELECT * FROM tblAccountPass where ACCOUNT='"
sqltemp=sqltemp & myname & "'"
rstemp.Open sqltemp, conntemp
If rstemp.EOF then %>
<BR>
I'm sorry, we don't have a user named <%=myname%> on file!<br>
Please contact ####### for access to this site.
<!--Please return to <A href="securitylogin.asp">Log In</a> and select
Register-->
<% Response.End
end if
If rstemp("Password")=mypassword then
session("name")=rstemp("account")
session("securitylevel")=rstemp("SecurityLevel")
Response.Redirect "toc.asp"
else
%>
Password Unrecognized<br>
Try <A href="securitylogin.asp">Try Again</a> again.
<% Response.End
end if
rstemp.close
conntemp.Close
set rstemp=nothing
set conntemp=nothing
%>
</BODY>