Wrox Home  
Search P2P Archive for: Go

  Return to Index  

access_asp thread: problem with session and login form


Message #1 by "Jim Losi" <jlosi1@t...> on Fri, 31 Aug 2001 23:32:24
ok, this is boggling my mind. Sessions are very new to me. I have the age 

old question about how to creat a login and maintain that a page cannot be 

shown if the session is empty



 think I'm getting closer to what I'm looking for. But it's still not 

setting the session properly. less files in this one.





LOGIN.ASP



<html>

<head></head>

<body>

<table bgcolor="#000000" width="100%" height="400" cellspacing="0" 

cellpadding="0" border="1">

<tr>

<td align="center">

<form name="login" method="post" action="verify.asp ">



<input type="text" name="AdminName">

<br>

<input type="password" name ="AdminPass">

<br>

<input type="submit" value="Login">

</form>

</td>

</tr>

</table>

</body>

</html>



***verify.asp***

<!--#include file="../Dim_Page.asp"-->

<!--#include file="../Connection.asp"-->

<%



session("user")=request("AdminName")

if session("user")="" then

response.redirect "login.asp"

end if



RS.Open "SELECT AdminName, AdminPass FROM tblAdmin " & _

"WHERE AdminName = '" & Request("AdminName") & "' AND " & _

"AdminPass='" & Request("AdminPass") & "'", MyConn



if RS.EOF then

response.redirect "login.asp"

else 

response.redirect "admincontrol.asp"

end if 



RS.close





%>





***admincontrol.asp***

<!--#include file="verify.asp"-->

<%



response.write "you made it"

%>



***global.asa***



<SCRIPT LANGUAGE=VBScript RUNAT=Server>



Sub Session_OnStart



session("user")=""

Session("Start") = Now

' Change Session Timeout to 20 minutes (if you need to)

Session.Timeout = 5

' Set a Session Start Time

' This is only important to assure we start a session





End Sub



</SCRIPT>





Ok.. i can feel that I'm really close to solving this.. but if any one can 

help, I would greatly appreciate it!

-Jim


  Return to Index