July 15, 200421 yr 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
July 15, 200421 yr 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
July 16, 200421 yr 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
July 21, 200421 yr Author Gary and Steve, Thanks very much for your good ideas. I found the solution I needed in the stripslashes() command. Very handy! Best, DSW
Create an account or sign in to comment