Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to list all attributes?

Status
Not open for further replies.

edeaux

Programmer
Mar 7, 2003
16
0
0
PH
I'm having a hard time finding a way to list all attributes. Please help me.
 
Try this:

<cfloop collection=&quot;#attributes#&quot; item=&quot;i&quot;>
<cfoutput>#i#</cfoutput><br>
</cfloop>

to list other collections, replace attributes with the collection.... URL, FORM, SESSION, COOKIE, CGI, etc....

have fun, hope that helps.

Kevin
 
This might be more usefull, show you the name and value of whatever, just change the var &quot;col&quot; to whatever collection you want to see.

<cfset col=&quot;attributes&quot;>

<cfloop collection=&quot;#evaluate(col)#&quot; item=&quot;i&quot;>
<cfoutput>#i# = #evaluate(col &&quot;.&quot;& i)#</cfoutput><br>
</cfloop>
 
Oooooooorrrr... if you're talking debugging and not necessarily making it &quot;pretty for da public&quot;, just use CFDUMP:

Code:
<CFDUMP var=&quot;#attributes#&quot;>
like:
Code:
<CFDUMP var=&quot;#FORM#&quot;>
<CFDUMP var=&quot;#URL#&quot;>
-Carl
 
Well... your code is still very valuable for situations where you're trying to output everything in some pretty format for a report or whatever, Kevin!

I'm just saying, if looks don't matter, and you're just after the values for testing or debugging, CFDUMP is a one-line wonder.
-Carl
 
Thanks for the posting sample codes. It really help a lot to my project. :)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top