日期:2014-05-17  浏览次数:20508 次

关于特殊符号的上传
小弟用CKEDITOR生成了一些纯html代码

<p style="text-align: center; ">
1.&quot;我&quot;</p>
<p>
<strong><em><u>2.&quot;爱&quot;</u></em></strong></p>
<p>
<span style="color:#ff0000;"><strike><u><em><strong><span style="font-size:20px;"><span style="font-family:trebuchet ms,helvetica,sans-serif;"><span style="background-color:#dda0dd;">3.&quot;你&quot;</span></span></span></strong></em></u></strike></span></p>


并成功赋值给了一个变量zt_text,这个变量是javascript的,不是php的哦!

我想用ajax把zt_text给传到后台

可是我只能得到 <p style=

因为后面有一个双引号

有没有什么办法可以不用替换任何字符

把html代码原模原样给保存到mysql里呢?

保存好了后

又怎么样用php给取出来,显示在页面上呢?

------解决方案--------------------
他是通过url传。你用post传试过了吗?
xmlHttp.open('post',url,true)
xmlHttp.setRequestHeader("Content-type","application/x-www-form-urlencoded");
xmlHttp.send(zt_text); //zt_text=你的html代码。

php端:
$zt_text=$_PSOT['zt_text'];

这样都试过了吗?