Sign In/My Account | View Cart  
advertisement

Article:
 Very Dynamic Web Interfaces
Subject: Coldfusion Server Script
Date: 2005-02-14 11:14:19
From: Sidvorak
Response to: Coldfusion Server Script

I had problems using the coldfusion code presented due to the <?xml?> declaration not being on the first line of the returned document. If whitespace suppression is not turned on in the Administrator you will have to use something like this. Notice that there is no hard return after the <cfcontent> tag.


<cfprocessingdirective suppresswhitespace="yes">
<cfcontent type="text/xml" reset="yes"><?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<response>
<method>checkName</method>
<cfoutput><result>#nameInUse(url.q)#</result></cfoutput>
</response>


<cfscript>
function nameInUse(q)
{
if (isdefined("q")){
switch(lcase(q))
{
case 'drew': {
return '1';
break;
}
case 'fred': {
return '1';
break;
}
default:
return '0';
}
}else
return '0';
}
</cfscript></cfprocessingdirective>


No Previous Message Previous Message Move up to Parent Message Up Next Message Next Message


Titles Only Titles Only Newest First
  • Coldfusion Server Script
    2006-01-09 12:40:30 david_sternberg [Reply]

    I cannot get the script to work. Can you email me at david_sternberg@yahoo.com so we can discuss this off line. I'm sure I am doing something stupid.


    Thanks
    Dave


Sponsored By: