Url and Form variables are all stored in a structure on the CF site.
Therefore, you can use StructFindValue (CF 4.5sp2) to search through the
structure and find the key that contains the value you want. Note the CFIF
statement to handle the times when the value doesn't exist. For a form, do
the same but substitute form for url.

<CFSET url.name="goofy">

<CFSET loc=StructFindValue(URL, 'goofy')>
<CFIF ArrayLen(loc)>
   <CFOUTPUT>
      #StructKeyList(loc[1]['owner'])#
   </CFOUTPUT>
</CFIF>


> Two part question. They are related
>
> Part 1:
>
> Let's say you have a page with lots of URL variables. (I.E. url.search,
> url.lang, url.homepage, url.custscript, url.start, url.end,
url.frontscope,
> etc. etc. etc.)
>
> And you don't want to code a CFIF for each URL seperately for the same
> parameter.
>
> (cfif url.search CONTAINS "goofy")
> do this
> (/cfif)
> (cfif url.lang CONTAINS "goofy")
> do this
> (/cfif)
> (cfif url.hompage CONTAINS "goofy")
> do this
> (/cfif)
> (cfif url.start CONTAINS "goofy")
> do this
> (/cfif)
>
> Is there a way to just say:
>
> (cfif attribute.url CONTAINS "goofy")
> do this
> (/cfif)
>
> Or something similar?
>
>
> Part 2:
>
> Is it possible to also encompass all form.* attributes in one shot?
Similar
> to the question above?
>
> Thanks.
>
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Structure your ColdFusion code with Fusebox. Get the official book at 
http://www.fusionauthority.com/bkinfo.cfm

Archives: http://www.mail-archive.com/[email protected]/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists

Reply via email to