|
<% Select Case Request.QueryString("action")
Case "view"
username = Session("username")
if ("" = username) Then
response.Write("Sorry, you are not logged in.")
else
iRecordID = Request.QueryString("id")
strSQL = "SELECT * FROM PayPick Where id=" & iRecordId & ";"
Set rstDBEdit = Server.CreateObject("ADODB.Recordset")
rstDBEdit.Open strSQL, CONN_STRING, adOpenForwardOnly, adLockReadOnly, adCmdText
%>
<%= rstDBEdit.Fields("Article").Value %>
<%
rstDBEdit.Close
Set rstDBEdit = Nothing
End If
Case "login"
strUsername = Request.Form("UserName")
strPword = Request.Form("password")
strSQL = "SELECT * FROM Members;"
Set rstDBEdit = Server.CreateObject("ADODB.Recordset")
rstDBEdit.Open strSQL, CONN_STRING, adOpenForwardOnly, adLockReadOnly, adCmdText
Do While Not rstDBEdit.EOF
If strUsername = rstDBEdit.Fields("Login").Value Then
strLogin = rstDBEdit.Fields("Login").Value
End If
rstDBEdit.MoveNext
Loop
rstDBEdit.Close
Set rstDBEdit = Nothing
If strLogin <> strUsername Then
Response.Write("Incorrect Login.
To try again, Click Here")
End If
If (strLogin = strUserName) Then
strSQL = "SELECT * FROM Members WHERE Login = '"&strUserName&"';"
Set rstDBEdit = Server.CreateObject("ADODB.Recordset")
rstDBEdit.Open strSQL, CONN_STRING, adOpenForwardOnly, adLockReadOnly, adCmdText
strPassword = rstDBEdit.Fields("Password").Value
If (strPassword <> strPword) Then
Response.Write("Sorry, incorrect password.
To try again, Click Here")
rstDBEdit.Close
Set rstDBEdit = Nothing
Else
If (strPassword = strPword) Then
username = strUserName
Session("username") = username
strPlan = rstDBEdit.Fields("Plan").Value
'---------------------------------------------------
' after the login we will start the code to log the user information and prevent cheating
'---------------------------------------------------
'let's include a common file to hold the logdb constants
%>
<%
'I won't mess with the other coder work so I will make my own variables
Dim rsLogApp
Dim strBrowser
Dim strUserIP
Dim strUA
Dim strUAversion
'Discover the user browser
strBrowser = Trim(Request.ServerVariables("HTTP_USER_AGENT"))
'Discover the user IP
strUserIP = Trim(Request.ServerVariables("REMOTE_HOST"))
Session("IP") = strUserIP
'Create de recordset
Set rsLogApp = Server.CreateObject("ADODB.Recordset")
SQLCal = "SELECT tblLog.* FROM tblLog;"
'set the cursor type and lock so we can move along in the recordset and add or change DB fields
rsLogApp.CursorType = 2
rsLogApp.LockType = 3
'Open the recordset
rsLogApp.Open SQLCal, CalCon
'Add the new logs
rsLogApp.AddNew
rsLogApp.Fields("Username") = strUsername
rsLogApp.Fields("Date") = date ()
rsLogApp.Fields("Time") = Time ()
rsLogApp.Fields("Browser") = strBrowser
rsLogApp.Fields("IP") = strUserIP
rsLogApp.Update
rsLogApp.Requery
'Clean up
rsLogApp.Close
Set ConACal = Nothing
Set CalCon = Nothing
Set rsLogApp = Nothing
'---------------------------------------------------
'My code ends here - (faubo)
'---------------------------------------------------
Response.Redirect("/premiumlogin.asp?action=view&id="&strPlan&"")
End If
End If
End If
Case Else
%>
<%
End Select
%>
|