|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
Get inside! Sample the range of functionality easily built with JMSL Library for Time Series Data Analysis, Heat Maps, Portfolio Optimization, Monte Carlo Simulation, Stock Price Charting and more. Download Now! |
|
#1
|
|||
|
|||
|
I am building a url for a cfm page with a tool that gets info from a DB. The link appear in regular HTML. It populates a form that is on a cfm page. The data in the db address field sometimes contains # symbols e.g. 1000 Main Street #101. This make Cold Fusion Freak-Out (makes me freak-out as well) by passing this in as a url string. How can this be fixed? Need help today. Thanks.
This is the current code: <cfif NOT IsDefined("url.a1")> <cfset #url.a1# = ""> </cfif> <input type="text" name="address" size="40" <cfif#a1# NEQ "">value=<cfoutput>#a1#</cfoutput></cfif>> |
|
#2
|
|||
|
|||
|
Try using the urlEncodedFormat() function when you output your query data into the URL string.
|
|
#3
|
|||
|
|||
|
This shouldnt matter
If ColdFusion is dealing with data that is alread in a variable, like data coming form a database, the ColdFusion will escape the chars automatically so if you had myDomain.com/index.cfm?someVal=#hiThere, ColdFusion wont spit it cause its not having to deal with it directly. The only time ColdFusion will die is if you try something like this Code:
<cfset myVar = "Hello there. I am #1"> <cfoutput>#myVar#</cfoutput> If your doing stuff like that you have to escape the pounds like so Code:
<cfset myVar = "Hello there. I am ##1"> <cfoutput>#myVar#</cfoutput> Steve |
![]() |
| Viewing: Dev Shed Forums > Programming Languages - More > ColdFusion Development > # and url String |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|