All forms are in the form scope...

It's always a good idea to scope your variables for security reasons.  It
ensures that you know exactly where the data is coming from and not
potentially from a misnamed variable that is higher up in the scope order of
precendence...

Eric

-----Original Message-----
From: Rob Voyle [mailto:robvo...@voyle.com] 
Sent: Wednesday, February 01, 2012 12:03 PM
To: cf-talk
Subject: Re: Escaping #


Hi Dave

My forms up until this time have been very simple and I have never defined
or specified the scope or structure of variables.

Is there a syntax for the cfloop if no structure is defined or is that when
i would need to use evaluate?

Thanks

Rob  

On 1 Feb 2012 at 12:46, Dave Watts wrote:

> 
> > What you had suggested didn't work as I hadn't scoped the
> variables so I got a
> > not defined error message when I tried 
> > <cfoutput>#variables["namefirst" & i]#</cfoutput>
> 
> You can use whatever scope the variables are in, though:
> 
> #form["namefirst" & i]#
> 
> > I tried <cfoutput>#["namefirst" & i]#</cfoutput> but that didn't 
> > work.
> 
> Right. The brackets indicate membership in a structure, but you didn't 
> specify the structure
> 
> structure[key]
> 
> Variable scopes are exposed as structures.
> 
> Dave Watts, CTO, Fig Leaf Software
> http://www.figleaf.com/
> http://training.figleaf.com/
> 
> Fig Leaf Software is a Veteran-Owned Small Business (VOSB) on GSA 
> Schedule, and provides the highest caliber vendor-authorized 
> instruction at our training centers, online, or onsite.
> 
> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> ~|
> Order the Adobe Coldfusion Anthology now!
> http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=
> houseoffusion
> Archive:
> http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:34
> 9719
> Subscription:
> http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
> Unsubscribe:
> http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
> 






~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Order the Adobe Coldfusion Anthology now!
http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:349735
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm

Reply via email to