• Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint
Share this Page URL
Help

Week: 3 At a Glance > Day 17—Content Page (content.asp)

Day 17—Content Page (content.asp)

The content page of the user customizable site includes one of the most extensive changes to the source code that we've made in the book. If the user has successfully logged in, a cookie is set with his ID so that he can revisit the site at any time and see his changes.

<%@LANGUAGE="VBSCRIPT"%> <!--#include file="../Connections/connChapter17.asp" --
>
<% If (not (Session("tempUserID")="")) Then
    Response.Cookies("UserID")=Session("tempUserID")
    Response.Cookies("UserID").Expires=#12/31/2030#
  strUserID=Session("tempUserID")
End If
If (Request.Cookies("UserID")="") Then
    Response.Redirect("login.asp")
Else
  strUserID=Request.Cookies("UserID")
End If
%> <%
Dim rsPageColor__varUserID
rsPageColor__varUserID = "0"
if (strUserID  <> "") then rsPageColor__varUserID = strUserID
%> <%
Dim rsContentColor__varUserID
rsContentColor__varUserID = "0"
if (strUserID  <> "") then rsContentColor__varUserID = strUserID
%> <%
Dim rsRegion1Content__varUserID
rsRegion1Content__varUserID = "0"
if (strUserID  <> "") then rsRegion1Content__varUserID = strUserID
%> <%
Dim rsRegion2Content__varUserID
rsRegion2Content__varUserID = "0"
if (strUserID  <> "") then rsRegion2Content__varUserID = strUserID
%> <%
Dim rsRegion3Content__varUserID
rsRegion3Content__varUserID = "0"
if (strUserID  <> "") then rsRegion3Content__varUserID = strUserID
%> <%
Dim rsRegion4Content__varUserID
rsRegion4Content__varUserID = "0"
if (strUserID  <> "") then rsRegion4Content__varUserID = strUserID
%> <%
Dim rsRegion1Location__varUserID
rsRegion1Location__varUserID = "0"
if (strUserID  <> "") then rsRegion1Location__varUserID = strUserID
%> <%
Dim rsRegion2Location__varUserID
rsRegion2Location__varUserID = "0"
if (strUserID  <> "") then rsRegion2Location__varUserID = strUserID
%> <%
Dim rsRegion3Location__varUserID
rsRegion3Location__varUserID = "0"
if (strUserID  <> "") then rsRegion3Location__varUserID = strUserID
%> <%
Dim rsRegion4Location__varUserID
rsRegion4Location__varUserID = "0"
if (strUserID  <> "") then rsRegion4Location__varUserID = strUserID
%> <%
set rsPageColor = Server.CreateObject("ADODB.Recordset")
rsPageColor.ActiveConnection = MM_connChapter17_STRING
rsPageColor.Source = "SELECT tblOption.optionValue  FROM tblPreference,tblOption
WHERE tblPreference.featureID='1' AND  tblPreference.optionID=tblOption.optionID
AND (tblPreference.userID='" + Replace(rsPageColor__varUserID, "'", "''") + "'
OR
tblPreference.userID=0)  ORDER BY tblPreference.userID DESC"
rsPageColor.CursorType = 0
rsPageColor.CursorLocation = 2
rsPageColor.LockType = 3
rsPageColor.Open()
rsPageColor_numRows = 0
%>
<%
set rsContentColor = Server.CreateObject("ADODB.Recordset")
rsContentColor.ActiveConnection = MM_connChapter17_STRING
rsContentColor.Source = "SELECT tblOption.optionValue  FROM
tblPreference,tblOption  WHERE tblPreference.featureID='2' AND
tblPreference.optionID=tblOption.optionID AND (tblPreference.userID='" +
Replace(rsContentColor__varUserID, "'", "''") + "' OR tblPreference.userID=0)
ORDER BY tblPreference.userID DESC"
rsContentColor.CursorType = 0
rsContentColor.CursorLocation = 2
rsContentColor.LockType = 3
rsContentColor.Open()
rsContentColor_numRows = 0
%>
<%
set rsRegion1Content = Server.CreateObject("ADODB.Recordset")
rsRegion1Content.ActiveConnection = MM_connChapter17_STRING
rsRegion1Content.Source = "SELECT tblOption.optionValue  FROM
tblPreference,tblOption  WHERE tblPreference.featureID='3' AND
tblPreference.optionID=tblOption.optionID AND (tblPreference.userID='" +
Replace(rsRegion1Content__varUserID, "'", "''") + "' OR tblPreference.userID=0)
ORDER BY tblPreference.userID DESC"
rsRegion1Content.CursorType = 0
rsRegion1Content.CursorLocation = 2
rsRegion1Content.LockType = 3
rsRegion1Content.Open()
rsRegion1Content_numRows = 0
%>
<%
set rsRegion2Content = Server.CreateObject("ADODB.Recordset")
rsRegion2Content.ActiveConnection = MM_connChapter17_STRING
rsRegion2Content.Source = "SELECT tblOption.optionValue  FROM
tblPreference,tblOption  WHERE tblPreference.featureID='4' AND
tblPreference.optionID=tblOption.optionID AND (tblPreference.userID='" +
Replace(rsRegion2Content__varUserID, "'", "''") + "' OR tblPreference.userID=0)
ORDER BY tblPreference.userID DESC"
rsRegion2Content.CursorType = 0
rsRegion2Content.CursorLocation = 2
rsRegion2Content.LockType = 3
rsRegion2Content.Open()
rsRegion2Content_numRows = 0
%>
<%
set rsRegion3Content = Server.CreateObject("ADODB.Recordset")
rsRegion3Content.ActiveConnection = MM_connChapter17_STRING
rsRegion3Content.Source = "SELECT tblOption.optionValue  FROM
tblPreference,tblOption  WHERE tblPreference.featureID='5' AND
tblPreference.optionID=tblOption.optionID AND (tblPreference.userID='" +
Replace(rsRegion3Content__varUserID, "'", "''") + "' OR tblPreference.userID=0)
ORDER BY tblPreference.userID DESC"
rsRegion3Content.CursorType = 0
rsRegion3Content.CursorLocation = 2
rsRegion3Content.LockType = 3
rsRegion3Content.Open()
rsRegion3Content_numRows = 0
%>
<%
set rsRegion4Content = Server.CreateObject("ADODB.Recordset")
rsRegion4Content.ActiveConnection = MM_connChapter17_STRING
rsRegion4Content.Source = "SELECT tblOption.optionValue  FROM
tblPreference,tblOption  WHERE tblPreference.featureID='6' AND
tblPreference.optionID=tblOption.optionID AND (tblPreference.userID='" +
Replace(rsRegion4Content__varUserID, "'", "''") + "' OR tblPreference.userID=0)
ORDER BY tblPreference.userID DESC"
rsRegion4Content.CursorType = 0
rsRegion4Content.CursorLocation = 2
rsRegion4Content.LockType = 3
rsRegion4Content.Open()
rsRegion4Content_numRows = 0
%>
<%
set rsRegion1Location = Server.CreateObject("ADODB.Recordset")
rsRegion1Location.ActiveConnection = MM_connChapter17_STRING
rsRegion1Location.Source = "SELECT tblOption.optionValue  FROM
tblPreference,tblOption  WHERE tblPreference.featureID='7' AND
tblPreference.optionID=tblOption.optionID AND (tblPreference.userID='" +
Replace(rsRegion1Location__varUserID, "'", "''") + "' OR tblPreference.userID=0)
ORDER BY tblPreference.userID DESC"
rsRegion1Location.CursorType = 0
rsRegion1Location.CursorLocation = 2
rsRegion1Location.LockType = 3
rsRegion1Location.Open()
rsRegion1Location_numRows = 0
%>
<%
set rsRegion2Location = Server.CreateObject("ADODB.Recordset")
rsRegion2Location.ActiveConnection = MM_connChapter17_STRING
rsRegion2Location.Source = "SELECT tblOption.optionValue  FROM
tblPreference,tblOption  WHERE tblPreference.featureID='8' AND
tblPreference.optionID=tblOption.optionID AND (tblPreference.userID='" +
Replace(rsRegion2Location__varUserID, "'", "''") + "' OR tblPreference.userID=0)
ORDER BY tblPreference.userID DESC"
rsRegion2Location.CursorType = 0
rsRegion2Location.CursorLocation = 2
rsRegion2Location.LockType = 3
rsRegion2Location.Open()
rsRegion2Location_numRows = 0
%>
<%
set rsRegion3Location = Server.CreateObject("ADODB.Recordset")
rsRegion3Location.ActiveConnection = MM_connChapter17_STRING
rsRegion3Location.Source = "SELECT tblOption.optionValue  FROM
tblPreference,tblOption  WHERE tblPreference.featureID='9' AND
tblPreference.optionID=tblOption.optionID AND (tblPreference.userID='" +
Replace(rsRegion3Location__varUserID, "'", "''") + "' OR tblPreference.userID=0)
ORDER BY tblPreference.userID DESC"
rsRegion3Location.CursorType = 0
rsRegion3Location.CursorLocation = 2
rsRegion3Location.LockType = 3
rsRegion3Location.Open()
rsRegion3Location_numRows = 0
%>
<%
set rsRegion4Location = Server.CreateObject("ADODB.Recordset")
rsRegion4Location.ActiveConnection = MM_connChapter17_STRING
rsRegion4Location.Source = "SELECT tblOption.optionValue  FROM
tblPreference,tblOption  WHERE tblPreference.featureID='10' AND
tblPreference.optionID=tblOption.optionID AND (tblPreference.userID='" +
Replace(rsRegion4Location__varUserID, "'", "''") + "' OR tblPreference.userID=0)
ORDER BY tblPreference.userID DESC"
rsRegion4Location.CursorType = 0
rsRegion4Location.CursorLocation = 2
rsRegion4Location.LockType = 3
rsRegion4Location.Open()
rsRegion4Location_numRows = 0
%>
<html>
<head>
<title>Misinformation</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
<body bgcolor="<%=(rsPageColor.Fields.Item("optionValue").Value)%>">
<div id="Layer1" style="position:absolute; width:270px; height:268px; z-index:1;
<%=(rsRegion1Location.Fields.Item("optionValue").Value)%>; background-color:
<%=(rsContentColor.Fields.Item("optionValue").Value)%>; layer-background-color:
<%=(rsContentColor.Fields.Item("optionValue").Value)%>; border: 1px none
#000000"><%=(rsRegion1Content.Fields.Item("optionValue").Value)%></div>
<div id="Layer2" style="position:absolute; width:270px; height:268px; z-index:1;
<%=(rsRegion2Location.Fields.Item("optionValue").Value)%>; background-color:
<%=(rsContentColor.Fields.Item("optionValue").Value)%>; layer-background-color:
<%=(rsContentColor.Fields.Item("optionValue").Value)%>; border: 1px none
#000000"><%=(rsRegion2Content.Fields.Item("optionValue").Value)%></div>
<div id="Layer3" style="position:absolute; width:270px; height:268px; z-index:1;
<%=(rsRegion3Location.Fields.Item("optionValue").Value)%>; background-color:
<%=(rsContentColor.Fields.Item("optionValue").Value)%>; layer-background-color:
<%=(rsContentColor.Fields.Item("optionValue").Value)%>; border: 1px none
#000000"><%=(rsRegion3Content.Fields.Item("optionValue").Value)%></div>
<div id="Layer4" style="position:absolute; width:270px; height:268px; z-index:1;
<%=(rsRegion4Location.Fields.Item("optionValue").Value)%>; background-color:
<%=(rsContentColor.Fields.Item("optionValue").Value)%>; layer-background-color:
<%=(rsContentColor.Fields.Item("optionValue").Value)%>; border: 1px none
#000000"><%=(rsRegion4Content.Fields.Item("optionValue").Value)%></div>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p align="center"><font face="Arial, Helvetica, sans-serif"><a
href="preferences.asp">Preferences</a></font></p>
</body>
</html>
<%
rsPageColor.Close()
%> <%
rsContentColor.Close()
%> <%
rsRegion1Content.Close()
%> <%
rsRegion2Content.Close()
%> <%
rsRegion3Content.Close()
%> <%
rsRegion4Content.Close()
%> <%
rsRegion1Location.Close()
%> <%
rsRegion2Location.Close()
%> <%
rsRegion3Location.Close()
%> <%
rsRegion4Location.Close()
%>


					  


PREVIEW

                                                                          

Not a subscriber?

Start A Free Trial


  
  • Creative Edge
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint