Forum Moderators: coopster
If someone could help me with this I'd be really apreciative. I am having problems with magic quotes. My script works fine on a server without them, but I need to use it on a server with them turned on as well. My problem is, I have a field where the admin can use PHP and it is eval'd when being output. My problem is, if something such as this is entered
echo 'This is BlueScreen\'s test';
Which is normally fine PHP, the magic quotes turns it to this when storing to the DB
echo \'This is BlueScreen\'s test\';
Which breaks it. Now, the only suggestion I have been given is to strip the slashes, but this results in
echo 'This is BlueScreen's test';
So the PHP doesnt work. Any ideas on how to rectify this and make the output to the DB be this
echo 'This is BlueScreen\'s test';
Which is what is originally typed in?
Thanks a lot :)
set_magic_quotes_runtime(0); [us2.php.net]
at the top of some scripts that are widely distributed.
echo "This is BlueScreen\s test";
Just a thought...