Author |
Topic |
|
kavaliotis
Starting Member
11 Posts |
Posted - 18 May 2001 : 17:14:34
|
Hello guys, i'm new to Dreamweaver but know some things about these kind of programs..Anyways i have created 2 pages with Dreamweaver UltraDEV 4 with *.asp extensions..The first one is a login page where someone enters username and password. I don't know how to create a database with usernames and passwords so that the user can be authenticated, but what i want it to do is to authenticate only the university staff of my uni, not the students. How can i make the "submit" button redirect them to the 2nd page i have created? I currently have the system running on my PC, not a network, but i will have to put it in the local university intranet.. The second page is a form with fields to fill like name, address, boxes to tick depending on likes and dislikes and stuff like that..How can i save these results in a database (preferably Microsoft Access) and then depending on the answers, find matches from other entries from other staff members and email them back the results? I know i ask too much, but the deadline is near and i have soooo much things to do for my final year project..All answers are welcomed..Thank you in advance!
|
|
e3stone
Average Member
USA
885 Posts |
Posted - 18 May 2001 : 17:59:36
|
Note: You have to be running this page on a server for the ASP code to work.
Well, you could build a table that has three fields: UserName, Password, & Level. Have all the staff be a level 1, students would be level 2. You might not even include the students in that table, so you could just have two fields: UserName & Password.
The form would submit the UserName and Password to the second page.
In the second page you'd have some code sort of like this:
<% UserName = request.form("UserName") Password = request.form("Password")
strConnString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=server_location_of_your_database\Name_of_your_database.mdb;" '## MS Access 2000
set my_Conn = Server.CreateObject("ADODB.Connection") my_Conn.Open strConnString
set rs = server.CreateObject("ADODB.RecordSet")
strSql = "SELECT NameOfYourTable.UserName, NameOfYourTable.Password" strSql = strSql & " FROM NameOfYourTable" strSql = strSql & " where NameOfYourTable.UserName='" & UserName & "' AND NameOfYourTable.Password='" & Password & "'" rs.Open strSQL, my_Conn
If rs.eof or rs.bof then response.write "You are not authorized to view this page" Else %>
Put your second page form code here
<% End If
rs.close set rs = nothing my_Conn.close set my_Conn = nothing
%>
That's some code that might work on your second page. Get that working and then you can tackle the likes/dislikes saving and matching, etc.
<-- Eric -->
http://insidewaco.com/forum/home.asp
Edited by - e3stone on 18 May 2001 18:01:18 |
|
|
kavaliotis
Starting Member
11 Posts |
Posted - 18 May 2001 : 19:04:27
|
Thank you very much, i haven't tried it yet though. In order to make the "SUBMIT" button that is on my login page redirect users to my second page, what should i do? in frontpage i could just put the name of the second page and it would go there, how can i do that with Dreamweaver? And ofcourse to check the username and password.. And what you said that i have to have it in a server, what do you mean? Won't it work in my laptop? Because i just want to emulate it until i upload it somewhere (probably in the university server or to a web page that supports asp and access..)..
|
|
|
|
Topic |
|
|
|