Jump to content

[SOLVED] Need Help with Cookie


limitphp

Recommended Posts

'Folk'

 

If you're getting \'Folk\', then you need to use stripslashes()

 

Thats wierd.  On my test machine php 5 with wamp server it works perfectly fine.  On the live site php 4 it doesn't work.

 

My web developer is telling me the cookie value is  'Folk', but for some reason on the page its saying the cookie value is \'Folk'\

 

Do you know why it would do that?

 

I tested to see what value its putting in the cookie...and its putting in 'Folk'.

 

But when I display the value it says its \'Folk\'

 

I don't understand how it can display the wrong value?

 

 

 

PHP automaticaly adds backslashes before all single quotes, double quotes, and backslashes to data that is received through GET, POST, and COOKIE. It's a security feature called Magic Quotes, and can be read about here on PHP's website: http://us3.php.net/manual/en/security.magicquotes.what.php and you can find out even more about it if you wish to google it or something. As KingPhilip said, simply using the function stripslashes() will take away the slashes added by Magic Quotes.

PHP automaticaly adds backslashes before all single quotes, double quotes, and backslashes to data that is received through GET, POST, and COOKIE. It's a security feature called Magic Quotes, and can be read about here on PHP's website: http://us3.php.net/manual/en/security.magicquotes.what.php and you can find out even more about it if you wish to google it or something. As KingPhilip said, simply using the function stripslashes() will take away the slashes added by Magic Quotes.

 

I see.  Thanks guys.

 

 

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.