PDA

View Full Version : directing with MS Access



tfinch
07-22-2004, 05:11 PM
Hello, I took over a site that is password protected in certain areas. I saw a database on the site with a password list on it. Depending on the word you type in, it will take you to different sections of the site. I looks simple enough but when I try to get it to work, it doesn't. Does anyone have some help links for ASP? It looks like there are only two pages for this task, plus the database, which is in Access.
What I want to do is make a database that will direct where people go depending on what they type in. For example, business will take you to business/index.htm
Any help is appreciated.
TF

sslcheap
07-25-2004, 12:28 PM
Try something like below:

default.asp

<form action=login.asp method=post>
Username <input name=username>
Password <input name=password>
</form>

login.asp

<%
Set adoconn = Server.CreateObject("ADODB.Connection")
adoconn.Provider = "Microsoft.Jet.OLEDB.4.0"
adoconn.ConnectionString = "Data Source=C:\mydir\mydb.mdb"
adoconn.Open
query = "select url from users where username = '" & Request("username") & "' and pw = '" & Request("password") & "'"
set rs = adoconn.execute(query)
if not rs.eof
Response.Redirect("url")
end if
rs.close
set rs = nothing
%>