是否有表单提交和卷曲的要求之间有什么区别? [英] What Differences Are There Between Form Submissions and cURL Requests?

查看:82
本文介绍了是否有表单提交和卷曲的要求之间有什么区别?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图将数据提交给SalesForce.com,但我想通过AJAX来做到这一点。既然有限制,以防止XSS,我有jQuery的使用AJAX提交到PHP页面我的服务器上,然后让该页面只是向前它沿正确的URL过去了,FORMDATA

I'm trying to submit data to SalesForce.com, but I'd like to do it through AJAX. Since there are restrictions to deter XSS, I'm having jQuery use AJAX to submit to a PHP page on my server and then having that page simply forward the formdata it's passed along to the proper URL.

如果我提交与JS关闭的形式,一切都经过精细。如果我打开它,Salesforce的确认收到的数据(在调试模式下),但它没有出现在我的队列,或任何地方真的,在SF。 SF吐回所有传递给它的领域,它的回吐出每一个领域,我在我的表格,正确填写。

If I submit the form with JS turned off, everything goes through fine. If I turn it on, Salesforce confirms receipt of the data (in debug mode), but it's not showing up in my queue, or anywhere really, in SF. SF spits back all of the fields it was passed, and it's spitting back every field that I have in my form, properly filled out.

有没有通过这个方式(jQuery的 $。阿贾克斯()来PHP卷曲)提交的东西之间​​的差异,并通过本机HTML提交按钮?东西可能会导致SF登记数据,但不同的注册呢?我试图加入 CURLOPT_HEADER / CURLOPT_HTTPHEADER 信息

Are there any differences between submitting something through this method (jQuery's $.ajax() to PHP cURL) and through the native HTML Submit button? Something that could be causing SF to register the data, but register it differently? I've tried adding CURLOPT_HEADER/CURLOPT_HTTPHEADER information

推荐答案

那么,唯一的不同了,你可以不假的请求的IP地址。根据多么艰难的保护是销售人员正在使用,您可能无法从一个单独的IP地址欺骗(它会检测并拒绝该请求)。

Well, the only thing that's different that you can't fake is the IP address of the request. Depending on how tough the protection is that salesforce is using, you may not be able to spoof from a separate IP address (it would detect and deny the request).

其他的一切应该是100%fakeable(头,等等)。我的建议是,你得到萤火虫或TamperData,并期待在原始的头被发送到Salesforce从您的浏览器正常。然后复制从PHP,准确的要求。如果你需要其他的信息,你可以检测到它的JS和它传递给PHP(Cookie信息,浏览信息等)...

Everything else should be 100% fakeable (headers, etc). What I would suggest is that you get firebug or TamperData and look at the raw headers being sent to salesforce from your browser normally. Then replicate that exact request from PHP. If you need other information, you could detect it in JS and pass it to PHP (Cookie information, browser info, etc)...

这篇关于是否有表单提交和卷曲的要求之间有什么区别?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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