<%@LANGUAGE="VBSCRIPT" CODEPAGE="1252"%> <% page=1 ' declare page number for bookmark and feedback functions If request.QueryString("bypass")=1 Then session("email")="test" End If '*************************************************************************************************** ' START PAGE ONE REGITRATION AND LAST VISIT SCRIPT '*************************************************************************************************** ' THIS IS ON PAGE ONE OF EVERY SBA COURSE. ' First, name this course for use in all queries. '------------------ ENTER DATA HERE! ----------------------------------------- '----------------------- v v ----------------------------------------------- '------------------------ v v ------------------------------------------------ '------------------------- v ------------------------------------------------- thiscourse= "esecurity" ' must be the directory name '----------------------------------------------------------------------------- '----------------- that is all the customizing there is! --------------------- '----------------------------------------------------------------------------- ' let's not run this more than once... '----------------------------------------------------------------------------- If session("updated")="" Then ' the asp version of Not IsDefined '----------------------------------------------------------------------------- '- this ensures that you are logged in. ' - if not, redirect to login, using coursename to ensure you get back here. '----------------------------------------------------------------------------- If session("email")="" Then response.redirect "../loginorregister.html?coursename=" & thiscourse End If '----------------------------------------------------------------------------- '----------------------------------------------------------------------------- '----------------------------------------------------------------------------- '- if logged in, checks to see if you are a guest login (immune to data collection). '----------------------------------------------------------------------------- If session("email")<>"guest" Then '----------------------------------------------------------------------------- '- If not a guest then '- looks for a record of this email in reg and this course '----------------------------------------------------------------------------- SQL = "Select * From Registration Where Email ='" & session("email") & "' AND coursename='" & thiscourse & "'" Set GetRegInfo = cnn.Execute( SQL ) '----------------------------------------------------------------------------- '- If you HAVE BEEN HERE BEFORE then '- update your last visit for this course and ends this script. '----------------------------------------------------------------------------- If not GetRegInfo.eof Then session("last_visit")=rs("Last_visit") SQL = "UPDATE Registration SET Last_visit ='" & Date() & "' WHERE Email='" & session("email") & "' AND Coursename='" & thiscourse & "'" cnn.Execute( SQL ) session("updated")="yes" if GetRegInfo("bookmark") <> "" Then session("bookmark")=GetRegInfo("bookmark") Else session("bookmark")="nobookmark.html" end if set GetRegInfo=nothing '----------------------------------------------------------------------------- '- If you HAVE NOT BEEN HERE BEFORE then '- update registration by adding this course for this registered email on this date. '----------------------------------------------------------------------------- Else SQL = "INSERT into Registration (Email,Coursename,Last_visit) " SQL = SQL & "VALUES ('" & session("email") & "','" & thiscourse & "','" & date() & "')" cnn.Execute( SQL ) session("updated")="yes" '----------------------------------------------------------------------------- ' Thats it. '----------------------------------------------------------------------------- End If ' not rs.eof cnn.close End If ' not a guest End If ' not updated already '----------------------------------------------------------------------------- '*************************************************************************************************** ' END END END END END END END END END END END END END END END END '*************************************************************************************************** %> e-Security
1 1 Menu Close
1
1 Next
1 1 1 1 1