Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
- <html>
- <head>
- <title>Subject Validation</title>
- </head>
- <cfscript>
- //Pulling all information from tehform on the previous page.
- userSite = Form.Site; //Default will always be Rice, so we don't need to test this :D
- userID = FORM.ID;
- userFName = FORM.FName;
- userLName = FORM.LName;
- userEmail = FORM.email;
- userSess = FORM.Sess_ID;
- </cfscript>
- <!-- We should also let the user know which site is actually being matched, cause that's helpful -->
- <CFQUERY DATASOURCE="tr3" NAME="qryParticipantsCheck">
- SELECT *
- FROM RunTR2
- WHERE session = #userSess#
- </CFQUERY>
- <cfset userSiteFirst = qryParticipantsCheck.SiteFirst>
- <cfset userRoundsTotal = 3>
- <cfset userRoundsCurrent = 1>
- <cfif userSite eq "RICE">
- <CFQUERY DATASOURCE="tr3" NAME="qryUserCheck">
- SELECT *
- FROM UsersTR2
- WHERE user_id = #userID# AND session_id = #userSess#
- </CFQUERY>
- <cfelseif userSite eq "UTD">
- <cfset part = qryParticipantsCheck.participants / 2>
- <cfset userID = userID + part> <!--- UTD will always be the station number + 12 [or how many ], so this will be the users ID --->
- <CFQUERY DATASOURCE="tr3" NAME="qryUserCheck">
- SELECT *
- FROM UsersTR2
- WHERE user_ID = #userID# AND session_id = #userSess#
- </CFQUERY>
- </cfif>
- <!--- Now we match up the user's entered information against the information stored on to UsersTR2 to make sure they entered everything correctly. --->
- <cfif qryUserCheck.RecordCount neq 1>
- <cflocation url = "Login.cfm">
- </cfif>
- <!--- User Exists! Let's store cookie information and update user information to the DB :D--->
- <!---UpdateDB--->
- <CFQUERY DATASOURCE="tr3" NAME="updateSession">
- UPDATE UsersTR2
- SET FNAME = "#userFName#", LNAME = "#userLName#", email = "#userEmail#"
- WHERE session_id = #userSess# AND user_id = #userID#
- </CFQUERY>
- <!--Cookies-->
- <cfset timer = createTimeSpan(0,3,0,0)>
- <cfcookie name = "user.ID" value = "#userID#" expires="#timer#"> <!-- this will expire in three hours -->
- <cfcookie name = "user.Site" value = "#userSite#" expires="#timer#">
- <cfcookie name = "user.Sess" value = "#userSess#" expires="#timer#">
- <cfcookie name = "user.FName" value = "#userFName#" expires="#timer#">
- <cfcookie name = "user.LName" value = "#userLName#" expires="#timer#">
- <cfcookie name = "user.Email" value = "#userEmail#" expires="#timer#">
- <cfcookie name = "user.SiteFirst" value = "#userSiteFirst#" expires="#timer#">
- <cfcookie name = "user.RoundsTotal" value = "#userRoundsTotal#" expires="#timer#">
- <cfcookie name = "user.RoundsCurrent" value = "#userRoundsCurrent#" expires="#timer#">
- <!-- And now we send the user off to wait.cfm where they will wait --->
- <!-- Users will not head to choose their picture choice --->
- <script type="text/javascript">
- location.href='picChoice.cfm';
- </script>
- <br><br>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment