Print Page | Close Window

Expected ’End’!?!?!?!?!

Printed From: Web Wiz Forums
Category: General Discussion
Forum Name: Classic ASP Discussion
Forum Description: Discussion on Active Server Pages (Classic ASP).
URL: https://forums.webwiz.net/forum_posts.asp?TID=2961
Printed Date: 29 March 2026 at 10:14am
Software Version: Web Wiz Forums 12.08 - https://www.webwizforums.com


Topic: Expected ’End’!?!?!?!?!
Posted By: pmormr
Subject: Expected ’End’!?!?!?!?!
Date Posted: 22 May 2003 at 8:13pm

i have this script, it checks two cookies, sees if they're there and either prints access granted or access denied (see below)

<%
   'Check my cookies so no one has any ideas about typing in the
   'filename automatically
   Dim l1
   Dim l2
   l1 = Request.Cookies("advertiser1")
   l2 = Request.Cookies("advertiser2")  
  
   If l1 = "" then
      Response.Write("ACCESS DENIED")
   Response.End
   Else If l2 = "" then     
   Response.Write("ACCESS DENIED")
   Response.End
   Else
      Response.Write("ACCESS GRANTED")

   end if 
%>

there's just one problem, it gives me this weird error that reads...

Microsoft VBScript compilation error '800a03f6'

Expected 'End'

/_scripts/_ASP/AW-BannerAd/Advertiser/display.asp, line 17

can anyone spot the error?



-------------
Paul A Morgan

http://www.pmorganphoto.com/" rel="nofollow - http://www.pmorganphoto.com/



Replies:
Posted By: michael
Date Posted: 22 May 2003 at 8:27pm

<%
   'Check my cookies so no one has any ideas about typing in the
   'filename automatically
   Dim l1
   Dim l2
   l1 = Request.Cookies("advertiser1")
   l2 = Request.Cookies("advertiser2")  
  
   If l1 = "" then
      Response.Write("ACCESS DENIED")
   Response.End
   ElseIf l2 = "" then     
   Response.Write("ACCESS DENIED")
   Response.End
   Else
      Response.Write("ACCESS GRANTED")

   end if 
%>

As corrected above, you put a space between else and if the command you mean is elseif OR you can write Else If but then a new if block is initiated and you need to have a second 'end if'.



-------------
http://baumannphoto.com" rel="nofollow - Blog | http://mpgtracker.com" rel="nofollow - MPG Tracker


Posted By: pmormr
Date Posted: 23 May 2003 at 1:03pm
thanks... i used the command for c++

-------------
Paul A Morgan

http://www.pmorganphoto.com/" rel="nofollow - http://www.pmorganphoto.com/



Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.08 - https://www.webwizforums.com
Copyright ©2001-2026 Web Wiz Ltd. - https://www.webwiz.net