redirect.asp code error

Author Message
kimphot

  • Total Posts : 1
  • Scores: 0
  • Reward points : 0
  • Joined: 1/7/2007
  • Status: offline
redirect.asp code error Sunday, January 07, 2007 10:54 PM (permalink)
0
This is the code on a redirect.asp page, which takes me to galleries.asp showing events2006.htm having clicked the initial button called "Cycle Photos":
<% If Request("SubArea") = "N" Then %>
 <% Response.Cookies("Copyright2005") = "Disagree" %>
 <% Response.Redirect "index.asp" %>
<% End If %>
<% strTemp = Request.Cookies("Copyright2005") %>
<% = strTemp %>
<% If strTemp = "Agree" Then %>
 <% Response.Redirect "galleries.asp?Yr=2006" %>
<% Else %>
 <% 'If Request("SubArea") = "Y" Then %>
  <% Response.Cookies("Copyright2005") = "Agree" %>
  <% Response.Cookies("Copyright2005").Expires = Date()+180 %>
  <% Response.Redirect "galleries.asp?Yr=2006" %>
 <% 'Else %>
  <% 'Response.Redirect "index.asp" %>
 <% 'End If %>
<% End If %>
<%
If Request("Yr") = "2006" Then
 Session("Yr") = "2006"
Else
 Session("Yr") = "2005"
End If
%>

I now want to go to galleries.asp showing events2007.htm
The code below gives an error when I click "Cycle Photos" 
""Error Type:
Microsoft VBScript compilation (0x800A03EA)
Syntax error
/kimroy2007/redirect.asp, line 23, column 6
Elseif
-----^

Browser Type:
Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; .NET CLR 2.0.50727)
Page:
GET /kimroy2007/redirect.asp "".
Is the code basically wrong or am I missing a reference somehere else in the site code? I am very new to programming and I thought the If...Then....Else staement was correct but it seems not and I cannot see why! See below:
 
<% If Request("SubArea") = "N" Then %>
 <% Response.Cookies("Copyright2005") = "Disagree" %>
 <% Response.Redirect "index.asp" %>
<% End If %>
<% strTemp = Request.Cookies("Copyright2005") %>
<% = strTemp %>
<% If strTemp = "Agree" Then %>
 <% Response.Redirect "galleries.asp?Yr=2007" %>
<% Else %>
 <% 'If Request("SubArea") = "Y" Then %>
  <% Response.Cookies("Copyright2005") = "Agree" %>
  <% Response.Cookies("Copyright2005").Expires = Date()+180 %>
  <% Response.Redirect "galleries.asp?Yr=2007" %>
 <% 'Else %>
  <% 'Response.Redirect "index.asp" %>
 <% 'End If %>
<% End If %>
<%
If Request("Yr") = "2007" Then
 Session("Yr") = "2007"
Elseif
 Session("Yr") = "2006"
Else
 Session("Yr") = "2005"
End If
%>
 
#1

    Online Bookmarks Sharing: Share/Bookmark

    Jump to:

    Current active users

    There are 0 members and 1 guests.

    Icon Legend and Permission

    • New Messages
    • No New Messages
    • Hot Topic w/ New Messages
    • Hot Topic w/o New Messages
    • Locked w/ New Messages
    • Locked w/o New Messages
    • Read Message
    • Post New Thread
    • Reply to message
    • Post New Poll
    • Submit Vote
    • Post reward post
    • Delete my own posts
    • Delete my own threads
    • Rate post

    2000-2012 ASPPlayground.NET Forum Version 3.9