%@ Language=VBScript %>
COEN 120 -
Real Time Computing
Instructor: Dr. Neil R. Quinn Jr.
<%
set LogonPassword = Request.Form("LogonPassword")
If Len(LogonPassword) > 0 then
'Clean data
LogonPassword = replace(LogonPassword,"'","")
' response.write Logon_Name & " COEN120 Student Survey
"
Set DB = Server.CreateObject("ADODB.connection")
DB.Open "COEN120StudentsFall2001", "COEN120Students", "COEN120Students"
SearchString = "SELECT * FROM Students WHERE (StudentID = " & LogonPassword & ")"
' response.write SearchString & "
"
Set DB_Results = DB.Execute(SearchString)
session("StudentID") = 0
while not DB_Results.eof
session("StudentID") = DB_Results("StudentID")
session("FirstName") = DB_Results("FirstName")
session("LastName") = DB_Results("LastName")
DB_Results.MoveNext
wend
if session("StudentID") = 0 then
Session.Timeout = 15
LogonPassword=""
Response.redirect ("StudentSurvey.asp")
end if
else
session("StudentID") = 0
LogonPassword=""
end if
%>
| <% end if %> | |
|
<% If session("StudentID") > 0 then
' allow only one logon per session
LogonPassword=""
GetStudents = "SELECT * FROM Students WHERE StudentID=" & session("StudentID")
' Response.Write GetStudents & " " Set DB_Results = DB.Execute(GetStudents) %> <% end if %> |
|