I have a problem with some coding that I hope someone can help me with. I am very new to ASP.
I have a Intranet site that employees log into. When they do, their username and password is verified. The coding for that is:
<html>
<head>
<title>Verification Page</title>
</head>
<body>
<%
Dim adoCon
Dim strCon
Dim rsCheckUser
Dim strSQL
Dim strUserName
strUserName = Request.Form("txtUserName")
session ("strUserName") = Request.Form ("txtUserName")
Set adoCon = Server.CreateObject("ADODB.Connection")
strCon = "Driver={Microsoft Access Driver (*.mdb)}; DBQ=" & Server.MapPath("../fpdb/Online_Briefing_Items.mdb")
adoCon.Open strCon
Set rsCheckUser = Server.CreateObject("ADODB.Recordset")
strSQL = "SELECT qrysignin.Password FROM qrysignin WHERE qrysignin.Userid ='" & session ( "strUserName" ) & "'"
rsCheckUser.Open strSQL, strCon
If NOT rsCheckUser.EOF Then
If (Request.Form("txtUserPass")) = rsCheckUser("Password") Then
Session("blnIsUserGood") = True
Set adoCon = Nothing
Set strCon = Nothing
Set rsCheckUser = Nothing
Response.Redirect"decision_page.asp?name=" & strUserName
End If
End If
Set adoCon = Nothing
Set strCon = Nothing
Set rsCheckUser = Nothing
Session("blnIsUserGood") = False
Response.Redirect"briefing_done_page.asp"
%>
<p> </p>
</body>
</html>
I have another page that once online, the employee goes to and reads information. Once the information is read and they check a box, the employee can no longer view that page. At least that is what I'm trying do, but I can't get it to work. I'm using the same coding as above but it is not picking up the username from the original sign in page. I have a session variable that displays the user's name on every page as long as they are signed in, but I can't seem to get the verification page to pick it up. Can anyone help?
I have a Intranet site that employees log into. When they do, their username and password is verified. The coding for that is:
<html>
<head>
<title>Verification Page</title>
</head>
<body>
<%
Dim adoCon
Dim strCon
Dim rsCheckUser
Dim strSQL
Dim strUserName
strUserName = Request.Form("txtUserName")
session ("strUserName") = Request.Form ("txtUserName")
Set adoCon = Server.CreateObject("ADODB.Connection")
strCon = "Driver={Microsoft Access Driver (*.mdb)}; DBQ=" & Server.MapPath("../fpdb/Online_Briefing_Items.mdb")
adoCon.Open strCon
Set rsCheckUser = Server.CreateObject("ADODB.Recordset")
strSQL = "SELECT qrysignin.Password FROM qrysignin WHERE qrysignin.Userid ='" & session ( "strUserName" ) & "'"
rsCheckUser.Open strSQL, strCon
If NOT rsCheckUser.EOF Then
If (Request.Form("txtUserPass")) = rsCheckUser("Password") Then
Session("blnIsUserGood") = True
Set adoCon = Nothing
Set strCon = Nothing
Set rsCheckUser = Nothing
Response.Redirect"decision_page.asp?name=" & strUserName
End If
End If
Set adoCon = Nothing
Set strCon = Nothing
Set rsCheckUser = Nothing
Session("blnIsUserGood") = False
Response.Redirect"briefing_done_page.asp"
%>
<p> </p>
</body>
</html>
I have another page that once online, the employee goes to and reads information. Once the information is read and they check a box, the employee can no longer view that page. At least that is what I'm trying do, but I can't get it to work. I'm using the same coding as above but it is not picking up the username from the original sign in page. I have a session variable that displays the user's name on every page as long as they are signed in, but I can't seem to get the verification page to pick it up. Can anyone help?