Solved

detecting user's url paths..

Posted on 2008-10-29
3
305 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

Highfive + Dolby Voice = No More Audio Complaints!

Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

Join & Write a Comment

Suggested Solutions

If you don't have the right permissions set for your WordPress location in IIS, you won't be able to perform automatic updates. Here's how to fix the problem.
Meet the world's only “Transparent Cloud™” from Superb Internet Corporation. Now, you can experience firsthand a cloud platform that consistently outperforms Amazon Web Services (AWS), IBM’s Softlayer, and Microsoft’s Azure when it comes to CPU and …
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…
You have products, that come in variants and want to set different prices for them? Watch this micro tutorial that describes how to configure prices for Magento super attributes. Assigning simple products to configurable: We assigned simple products…

743 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

9 Experts available now in Live!

Get 1:1 Help Now