问题"&安培;"使用Ajax时将数据发布到PHP签署 [英] problem with "&" sign when using ajax to post data to php

查看:127
本文介绍了问题"&安培;"使用Ajax时将数据发布到PHP签署的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用TinyMCE的是我的编辑。 一切都很好用发送内容保存在数据库或回声出来。但是,当一个&符号&放大器;来了,在那之后截断的所有数据,并且不保存在数据库或回声出 我该怎么办。在这里,我有文件,它只有1KB,请下载,运行它 谢谢大家。

i use tinyMce as my editor. everything is fine with sending content to save in database or echo it out. but when an ampersand sign "&" comes , all data after that truncated and dont save in database or echo out what should i do. here i have file , it's only 1kb, please download it, run it thank you everyone.

下载文件

请,如果你能罚的方式来摆脱&放大器;签署告诉我和其他人...。

please if you could fine a way to get rid of "&" sign tell me and others how... .

推荐答案

这个问题肯定是在JS。你应该使用EN codeURIComponent()发送urlen codeD信息。在

the problem is surely in the js. you should use encodeURIComponent() to send urlencoded information. as in

var parameters = 'message='+encodeURIComponent(message);

EN codeURIComponent()上W3Schools的

这篇关于问题"&安培;"使用Ajax时将数据发布到PHP签署的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆