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

escaping/replacing single quotes

Status
Not open for further replies.

scotth4v

Programmer
Apr 17, 2001
103
US
Hi gang,

I've got a little bug that I band-aided a long time ago, but would really like to fix. I built a bugtracker using Servlets/XML/XSL/SQL 7. Here's my problem. When a user creates a new project in the BT, if they use an apostrophe, it breaks a SQL insert somewhere in the chain of events. (I create default versions, subprojetcs, release dates, etc. using the new provided project name.) Now the band-aid I used was to use a JavaScript to parse the string and replace ' with \" before the submit. I also tried escaping the whole string to convert all special characters, but then my projects end up something like "Dragon%27s Wild" :)

What's the best solution here? I'm pretty green, but I'm learning :)

Thanks, and happy holidays!

-Scott
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top