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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

listtoarray and ampersand

Status
Not open for further replies.

LongHorn

Programmer
Jun 20, 2001
30
US
I have an array and want to put the elements into variables.
One of the elements has the ampersand in it. Thus causing all the elements after it to be unassigned/undefined.


<cfset attributes.contact_id = #attributes.projectarray[1]#>
<cfset attributes.contact_name = #trim(attributes.projectarray[2])#>
<cfset attributes.addr_id = #attributes.projectarray[3]#>
<cfset attributes.address = #attributes.projectarray[4]#>
<cfset attributes.site_id = #attributes.projectarray[5]#>
<cfset attributes.account = #attributes.projectarray[6]#>
<cfset attributes.permit_num = #attributes.projectarray[7]#>

If the address (element 4) has the & in it, attributes site_id, account and permit_num are undefined because the system thinks that the array has only 4 elements and not 7.

Does anyone know why?

Thanks.
 
Can you give a little more detail? I've tried the example above with my own variables, and can't generate a shorter array using a &quot;&&quot;.

How is projectarray generated? Is it pased via cfmodule, custom tag, or some other way? Does the address value come from a form or database or something else?

etc... - tleish
 
Thank you, tleish.
Your reply gave me the clue as to where the error lies. The entire array was passed as an URL variable and I didn't have it URLEncodedFormatted.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top