ori_wel Posted July 15, 2004 Posted July 15, 2004 I have a database set up to receive form information. The pages are written making use of PHP and Chris Hansen's FX. Works great. I just noticed, however, that the symbols ' and " appear as ' and ". The backslashes get put into the database field. It happens on text fields and textareas. Can anyone give me a push here? Thanks in advance for the help. O_W
Garry Claridge Posted July 15, 2004 Posted July 15, 2004 Quotes are always a problem when using "middleware". Hence, one way of dealing with them is to "escape" them with a "". If you need them removed you will be able to do something about it. What to do, depends on what your needs are. Good Luck. Garry
Steve T. Posted July 16, 2004 Posted July 16, 2004 As Garry mentions, is a single-character escape character so PHP ignores whatever follows. I guess FileMaker already auto-converts other characters for you, too... For exmple, in a php/mysql thing I am working on, I am trying to allow raw data into the db with no character conversion so that looking at the db directly shows normal characters... but if somone were to enter data that was HTML code like <BR>, it ends up getting into the php-generated HTML page as an actual line break. I have to use PHP's htmlspecialchars() function on every field when I display it if I want to keep people from being able to markup their own data. htmlspecialchars() works on quotes, too, I think. I can use it when the data goes in, too, I suppose, but if I have to do it anyway, I'd rather do it on the showing of the data rather than storing it already converted for web viewing. HERE IS THE PHP MANUAL PAGE that talks about strings and single/double quotes. --ST
ori_wel Posted July 21, 2004 Author Posted July 21, 2004 Gary and Steve, Thanks very much for your good ideas. I found the solution I needed in the stripslashes() command. Very handy! Best, DSW
Recommended Posts
This topic is 7767 days old. Please don't post here. Open a new topic instead.
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now