开发者

CKEditor is saving text with extra slashes in HTML tags

开发者 https://www.devze.com 2022-12-12 05:37 出处:网络
When I retrieve the data from the textarea in the form, <?php $editor_data = $_POST[\'editor1\']; ?>

When I retrieve the data from the textarea in the form,

<?php $editor_data = $_POST['editor1']; ?>

this works fine locally.

The remote server, however, returns the text mixing up the style with escape slashes, like this:

<h3 style=\"color: blue;\"> Initial va开发者_Python百科lue.</h3>

I've no idea what I'm doing wrong. Do you have any idea?


See: http://www.php.net/manual/en/info.configuration.php#ini.magic-quotes-gpc

You can use stripslashes function (http://www.php.net/stripslashes) if you cannot modify php.ini


Since Magic quotes has been DEPRECATED as of PHP 5.3.0 and REMOVED as of PHP 5.4.0, stripslashes($string) is the way to go.

0

精彩评论

暂无评论...
验证码 换一张
取 消