Jump to content

Question: escapes in text areas. Apache on linux vs win


horseatingweeds

Recommended Posts

I run Apache on a Windows setup for testing but publish on a Linux server. I use a text area and text inputs to add information and create pages. On Windows/Apache I had it working fine. After moving it to Linux apostrophes were escaped in the output, and only if I typed them is. Pasting them, they were not escaped. Example: Bill's  shows up as  Bill/'s

 

I'm not sure what code to show. I'm just loading the input value into a database, then outputing it into an html template. I've removed the filters to see if I had something funny in there, but no change. I'm thinking this must be something with how Linux treats text.

 

Any ideas?

Slashes automatically added to post/get/cookie data is due to the magic_quotes_gpc setting being on. Slashes automatically added to data from databases and files is due to the magic_quotes_runtime setting being on.

When inserting data into a database you should be using mysql_real_escape_string(). Then when outputting the data in your HTML template you can use stripslashes().

 

This is not true. There's no need to remove slashes from a string ONLY escaped with mysql_real_escape_string() when retrieving it from the database.

 

If you have magic_quotes on, then you must stripslash.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.