]
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
With the example below if I visit
http://sitename/test.cfm?no=3 and I am not logged in to view the
content on that page. i.e. (session.permission) has not been set
The page content displays and does not redirect ?
How could I modify the cfif below to check that if a user visits
works fine for me!
Test not logged in:
cfparam name=url.no default=0
cfset request.restrict = 3
cfset session.permission = notadmin
cfif listfind(request.restrict,url.no) and
comparenocase(session.permission,admin) neq 0
cflocation url=index.cfm
/cfif
Page contentbr
cfoutput
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
Because the url.no is always three in your example. The if statement
always will dump out after the first conditional, since it is always true.
switch 'em around:
cfif (url.no IS 3) and (session.permission is admin)
Page Content
cfelseif url.no IS 3
cflocation url=index.cfm
Problem lies in that url.no is alway 3 and it will process the first line.
Do this...
cfif url.no EQ 3 and session.permission NEQ admin
cflocation url=index.cfm
cfelseif (url.no IS 3) and (session.permission is admin)
Page Content
cfelse
/cfif
You have to add the not admin to give it a
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
[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
=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
:[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
10 matches
Mail list logo