Jump to content

This topic is 7500 days old. Please don't post here. Open a new topic instead.

Recommended Posts

Posted

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

Posted

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

Posted

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

Posted

Gary and Steve,

Thanks very much for your good ideas.

I found the solution I needed in the stripslashes() command. Very handy!

Best,

DSW

This topic is 7500 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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.