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
%>