Jump to content

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

Grrrr. it was the function to handle those nasty magic quotes I added last week. I'm glad magic pain is going to be removed in PHP6

 

EDIT: Nope not solved, brain fart. still the same problem and it's not caused by my magic quotes sniper (currently disabled).

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.