Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsGeneralPHPASPPerlColdFusionFlashHTML, CSS, ScriptsBrowsers

Webmaster Forum / ColdFusion / Advanced Techniques / May 2007



Tip: Looking for answers? Try searching our database.

Element is undefined in URL

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
DARAB - 31 May 2007 20:16 GMT
I can't seem to use a named field in a URL's querystring when it contains a
hyphen. Here's my code:

<body>
    item1 = <cfoutput>#url.item1#</cfoutput>
    orderID = <cfoutput>#url.orderID#</cfoutput>
    card_type = <cfoutput>#url.card-type#</cfoutput>
</body>

I have no problem with item1 or orderID but card-type returns the error
message:

" Element CARD is undefined in URL."

This URL is coming from a third party so I can't change it.
Ian Skinner - 31 May 2007 20:33 GMT
> I can't seem to use a named field in a URL's querystring when it contains a
> hyphen. Here's my code:
[quoted text clipped - 11 lines]
>
>  This URL is coming from a third party so I can't change it.

This seems to be the week of the "array notation".

You can not use an invalid variable name string in a dot notation
expression.  What ColdFusion is trying to do is evaluate 'url.card'
minus 'type' and can not find an 'url.card'.

To use invalid variable string names one need to use array notation.
url["card-type"] should get you what you want.
koencidence - 31 May 2007 21:01 GMT
Have you tried dumping the URL scope to see if it's in there any other way?

You could also use the cgi.query_string variable to parse it out if for some reason ColdFusion doesn't like it.

Koen
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.