How to escape $ in text? - jgold723 - Mar 22nd, 2016
I using Formtools to build a classified ad database. It works great and I'm built a little PHP to connect with the database to pull and print data.
It works great, but I'm finding that any $ in the text are being interpreted as variables, which breaks the price that follows them in the ad, which should read "The boat sells for $5,900" but ends up reading "The boat sells for ,900". This doesn't happen if I escape the $ manually. So, how can I modify my submission form so that $ are escaped?
I would need to do this at two points -- the form I use for the public to enter their own classified ads and also on the admin side of Formtools where I enter classified ads.
RE: How to escape $ in text? - alexh - Mar 22nd, 2016
Interesting question. I think the issue can be resolved in your code that prints the information from your database, instead of editing all of your formtools data. I suppose you could use the submission preparser to get rid of $ signs for new submissions.
Can you post your code that displays the data?
|