Solved

detecting user's url paths..

Posted on 2008-10-29
3
309 Views
Last Modified: 2013-12-24
I have a site with a global header with navigation tabs.  In a portion of the site I have a members only section.  I want to be able to use an alternate tab while the url path is with in a particular section ONLY.

For example these would get  the special header:
www.foo.com/members/index.cfm
www.foo.com/members/upgrade/index.cfm

Thes would not:
ww.foo.com/index.cfm
www.foo.com/public/index.cfm

I thought id use a cfif in my header file to detect the path the user is on.  Using #cgi.script_name# or #cgi.http_referer#.
Maybe like this:
<cfif #cgi.script_name#  EQ /members/>
show this header image
<cfelse>
show regular header image
</cfif>

But I wanted something more like intelligent like
<cfif #cgi.script_name#  EQ /members/*.cfm>

It's flawed, as it can't determine what each page would be as I add new ones. Help! Need this ASAP ...

Thanks,
PM
0
Comment
Question by:PhotoMan2000
3 Comments
 
LVL 27

Expert Comment

by:azadisaryev
ID: 22833772
<cfif listfindnocase(cgi.script_name, 'members', '/')>
0
 
LVL 11

Accepted Solution

by:
jimmy282 earned 500 total points
ID: 22839508
or

<cfif cgi.path_info contains "/members/">

0
 

Author Closing Comment

by:PhotoMan2000
ID: 31511268
Worked great.. I should have known that! Didn't see it in the cgi list CFDUMP I did for the CGI variables..
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

A web service (http://en.wikipedia.org/wiki/Web_service) is a software related technology that facilitates machine-to-machine interaction over a network. This article helps beginners in creating and consuming a web service using the ColdFusion Ma…
Periodically we have to update or add SSL certificates for customers. Depending upon your hosting plan you may be responsible for the installation and/or key generation. In the wake of Heartbleed many sites were forced to re-key. We will concen…
Internet Business Fax to Email Made Easy - With eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…
As a trusted technology advisor to your customers you are likely getting the daily question of, ‘should I put this in the cloud?’ As customer demands for cloud services increases, companies will see a shift from traditional buying patterns to new…

920 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

15 Experts available now in Live!

Get 1:1 Help Now