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

escaping apostrphee in a select statement

Status
Not open for further replies.

cfdeveloper

Programmer
Nov 20, 2003
144
GB
Hi Guys,

I'm passing a url variable a string/text that has a apostrphee in it.

Ex:
mytext = It's a test

I'm escaping it like this:

window.location.href = "somepage.cfm?txt="+escape(mytext);

I'm passing this url varialbe, url.txt to the select statement,

I get an error:

Incorrect syntax near 's'.

Can someone show me how to get round this please.

Best regards
cfcoder
 
window.location.href = "somepage.cfm?txt="+mytext;

why use escape command???



Known is handfull, Unknown is worldfull
 
window.location.href = 'somepage.cfm?txt=#urlencodedformat(mytext)#';

ALFII.com
---------------------
If this post answered or helped to answer your question, please reply with such so that forum members with a similar question will know to use this advice.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top