Ok, here's my issue. I've got a challenge tracking system that, obviously, people can put challenges into. The problem I'm having is with keeping any ''' characters they put in. Since I'm storing this info in MySQL, I put in slashes before any database non-friendly characters, like ' and ". How do I go about removing the slashes that addcslashes puts in, but not the ones the user puts in. To date I've tried:
- calling htmlentities() on the incoming text before it's put in the database, to hopefully convert user entered ''' to their html code equivalent.
- calling stripcslashes() on the outgoing text which I had thought would only strip slashes that came before ' or ".
At this point, the only solution I can think of is to go through the incoming string character by character and change all occurrences of ''' to its html code equivalent.
Is there a cleaner more work intensive (for me
Thanks.