Coldfusion 8: IsDefined('URL.variable') and is not ""?

dcolumbus picture dcolumbus · Nov 9, 2010 · Viewed 16.1k times · Source

I'm trying to find out if a url variable exists, and if it doesn't, make sure that it's not empty.

This does not work:

<cfif IsDefined('URL.affiliateId') and is not "">
    //
</cfif>

Answer

scrittler picture scrittler · Nov 9, 2010
<cfif structKeyExists(url, 'affiliateID') and trim(url.affiliateID) neq "">...</cfif>