Photo Gallery Member List Search Calendars FAQ Ticket List Log Out


redirect.asp code error

 
Logged in as: Guest
arrSession:exec spGetSession 2,3,41782
 Active Users: There are 0 members and 0 guests.
 Users viewing this topic: none
 

 

 
  
  Printable Version
All Forums >> [Scripting] >> ASP >> redirect.asp code error
  Do you like VisualBasicScript.com? Link to us and help spread the word about our forum. Thanks!
Page: [1]
Login
Message << Older Topic   Newer Topic >>
 redirect.asp code error - 1/7/2007 9:54:16 PM   
  kimphot


Posts: 1
Score: 0
Joined: 1/7/2007
Status: offline
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
%>
 
 
Post #: 1
 
 
 
  

If you found our site useful please link to us <a href="http://www.visualbasicscript.com">VisualBasicScript.com</a>.
All Forums >> [Scripting] >> ASP >> redirect.asp code error Page: [1]
Jump to:





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
 Post New Thread
 Reply to Message
 Post New Poll
 Submit Vote
 Delete My Own Post
 Delete My Own Thread
 Rate Posts