ASP login problem

hi,

im new to asp and i just came across a login database using asp and downloaded…but after following the readme file and setting up everything as it says, there are problems right from the start…

http://www.atreyuonline.com/site/default.asp

try it for yourself, and see what you can make of it :frowning: i don’t have a clue whats wrong with it as i’m totally new to this…I’ve attached the files and would be AMAZINGLY greatful if someone could take a look and see if you can put them right for me…so i can review them and see what was rong…

thanks alot :slight_smile:

Quite a complex login script. Do you really need all that?

This will check to see if the login is correct and send users to their personal page. This is just to give you an idea of what you would like to do.


     <% 
	un=request("un")
	pw=request("pw")
     %>

<% Dim conn, rsNames %>

<% MyPath=Server.MapPath("database.mdb") %>

<% Set conn=Server.CreateObject("ADODB.Connection") %>

<% conn.Open "Driver={Microsoft Access Driver (*.mdb)};" & _
	"DBQ=" & MyPath %>

<% SQL= "SELECT * FROM ADMIN" %>

<% Set rsNames = conn.Execute(SQL) %>

		<%
			Match = "no"
		%>
	<% Session("un")=un
	   Session("ps")=ps
	 %>		

<% Do While Not rsNames.EOF %>

	<%  If un=rsNames("USERNAME") And pw=rsNames("PASSWORD") Then
			
		Match= "yes"

	    End if
	%>		

<% rsNames.MoveNext %>

<% Loop %>

<% Response.Write (Match) 
	    If Match= "yes" then 
		Response.Redirect un & ".asp"
	    End If
%>

Just make a small db to test it. However this is not the “best” login script to use, but like I said, just t give you an idea.

Are you by chance using Dreamweaver? There are Log-In and Restrict Access to Page server behaviors built-in. The only other thing you need to do is to create the username/password table in your database.

*Originally posted by abzoid *
**Are you by chance using Dreamweaver? There are Log-In and Restrict Access to Page server behaviors built-in. The only other thing you need to do is to create the username/password table in your database. **

That’s pretty nifty :cool: Personally I hate generating server side code with Dreamweaver. I find it to be more strenious than actually writing it myself. But that’s just my opinion.

joso: maybe take abzoid’s advice since your not familiar with ASP