Jump to content

[SOLVED] Problems with stripslashes


Jacky

Recommended Posts

Hi,

 

I have a small script giving me some headaches and hope somebody can help a girl out.

 

The two lines below is the test text I use.

Sandy said, "It's a beautiful day outside and I like to use \'s."

C:\Windows\system.txt

 

And this is what I get from the DB after running stripslashes:

Sandy said, "It's a beautiful day outside and I like to use 's."

C:Windowssystem.txt

 

 

I insert the data from a form which is submitted via POST. I retrieve the $_POST value and addslashes. Here is the MySQL string retrieved via die($sql);

 

update ticket set Service_Performed="Sandy said, \"It\'s a beautiful day outside and I like to use \\\'s.\" C:\\Windows\\system.txt  Last Saved by admin on May-28-2007, 6:00 pm",Tech_Notes="",Status_id="2" where ID="24" 

 

As you can see it contains the proper slashes.

Doing it the same way, here is the string retrieved from the database right after the select query before running stripslashes:

Sandy said, "It's a beautiful day outside and I like to use \'s." C:\Windows\system.txt

 

Why is this? I have not executed strip slashes but the slashes have been stripped already. I connected to Mysql via command line and noticed that a table query did not show the additional slashes either. Does anybody know what is causing this automatic stripslash behavior?

 

PHP: 5.2.0

MySQL: 5.0.26

 

Thank you for reading....

 

Link to comment
https://forums.phpfreaks.com/topic/53325-solved-problems-with-stripslashes/
Share on other sites

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.