<cfparam name="url.no" default="0"> <cfset request.restrict = "3">
<cfif listfind(request.restrict,url.no) and comparenocase(session.permission,"admin") neq 0> <cflocation url="index.cfm"> </cfif> Page content <cfinclude template="pages/#url.no#.cfm"> -----Original Message----- From: Ian Vaughan [mailto:[EMAIL PROTECTED] Sent: 20 July 2005 16:05 To: CF-Talk Subject: RE: CFIF logic problem However The cfif url.no IS 3 etc displays dynamic content out of the database based on the url.no=. So for example http://sitename/test.cfm?no=3 Would bring back the content ' NEWS' While http://sitename/test.cfm?no=2 Would bring back the content 'BUSINESS' So I need the cfif statement to display the content as normal if the url.no is 1 or 2 or 4 etc.. But if it is url.no=3 then apply the logic so that if a user has not logged in and they do not have a session.permission is "admin" then use cflocation back to the index.cfm page -----Original Message----- From: Larry Lyons [mailto:[EMAIL PROTECTED] Sent: 20 July 2005 15:01 To: CF-Talk Subject: CFIF logic problem >Hi > > >Is my logic correct in the code below ? > > ><cfif url.no IS "3"> ><cflocation url="index.cfm"> ><cfelseif (url.no IS "3") and (session.permission is "admin")> > >Page Content > ><cfelse> ></cfif> > >What I want is if the url is http://sitename/test.cfm?no=3 > >Then it will transfer back to the index.cfm page. > >However if the url is http://sitename/test.cfm?no=3 and the >session.permission has been set to 'admin' from the user login then the >page content displays. > >At present however the page keeps redirecting to the index.cfm page. > You may want to break up the CFIF into something like this: <cfif url.no IS "3"> <cfif session.permission is "admin"> Page Content <cfelse> <cflocation url="index.cfm"> </cfif> </cfif> hth, larry -- Larry C. Lyons Web Analyst BEI Resources American Type Culture Collection email: llyons(at)atcc(dot)org tel: 703.365.2700.2678 -- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~| Find out how CFTicket can increase your company's customer support efficiency by 100% http://www.houseoffusion.com/banners/view.cfm?bannerid=49 Message: http://www.houseoffusion.com/lists.cfm/link=i:4:212318 Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4 Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4 Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4 Donations & Support: http://www.houseoffusion.com/tiny.cfm/54