我有HTML数据像文本包括图像src.when我警觉使用jquery它工作正常。整个HTML显示在警报box.And然后我想发送完整的HTML数据和文本和JQuery的喜欢的东西的ID使用查询字符串:如何修复这些类型
$.post('something.php','socialprofileid='+socialprofileid+
'&txtMsg='+msg+'&postedHtmlMsg='+HtmlMsgresult)
但我需要一个完整的HTML数据,包括文本和id在PHP页面像获取html数据,文本,ID在JQuery警示框中
我尝试使用window.btoa函数(base64编码格式)为HtmlMsgresult。在javascript中执行base64编码格式后,当我尝试在php页面中发送时,它在php页面中没有得到任何打印。
另一件事是,有什么解决办法文字和htmldata(HTML文本和IMG SRC)合并,然后将其完成的base64 encode.And那么它使用的查询字符串在PHP页面发送类似:
if(txtmsg='') {
var result=window.btoa(htmldata);
} else {
var content=text+htmldata;
var result=window.btoa(content);
}
$.post('something.php','socialprofileid='+socialprofileid+'&result='+result)
有没有可能做到这一点?
然后我想在something.php中插入数据库,然后在另一个页面中,我想要使用jquery获取由base64编码的htmldata和文本。然后它被base64_decode函数转换。
但是在文本和htmldata中,如何从数据库表中提取文本,htmltext,htmlimgsrc。
如果你知道有关这些类型的问题,请回复我
我需要你的手
谢谢
我通过parametre在encodeURIComponent方法等变种的param1 = encodeURIComponent方法( “socialprofileid:socialprofileid,txtMsg:MSG,postedHtmlMsg:HtmlMsgresult”); 这些主题有一些问题。 1.html的数据不会来,txtMsg,postedHtmlMsg的img src来2.如何在php页面中个别地分隔param。我只需要使用socialprofileid和textMsg和htmldata文本与img src不同。如果我们在数据库表中插入不同类型的htmldata,如何从数据库表中以特定方式从htmldata中提取文本和img src.How to fix it。我需要你的手。 – 2012-02-22 10:37:04
这是错的。 1)在jQuery的帮助下,你不必这样做。 2)你没有看例子! 'param1 =“socialprofileid =”+ encodeURIComponent(socialprofileid)+“&txtMsg =”+ encodeURIComponent(msg)+ ...'等等。 'htmldata的Img src不来'我不知道你在'HtmlMsgresult'中有什么''如何在php页面中个别地分隔param'我向你展示了你应该如何处理POST数据。运行'phpinfo();'在POST上,你会自己看到它。 – Cheery 2012-02-22 17:14:30