CURL PHP AJAX请求


                    

我对使用CURL并不陌生,但过去我已经成功地将其提交了普通表格。 我正在使用AJAX请求执行登录的网站,我可以获取填写用户名和密码的表格,但是由于登录按钮实际上是链接,所以我无法提交表格, 其他可以登录的方式?</ p>

我实际上研究了禁用javascript时用户如何登录该站点,以为他们可能提供了另一种登录路径。 但是,开发人员以用户禁用javascript时该站点无法正常运行的陈述作为回应。 既然是这种情况,也许使用cURL甚至不可能做到这一点?</ p>

非常感谢任何有关我应该如何进行的建议!</ p>
     </ div>

展开原文

原文

I'm new to using CURL, but I have successfully got it to submit ordinary forms in the past. I'm working with a website that uses an AJAX Request to perform a login, I can get the form to fill out the username and password but since the login button is actually a link I can't get the form to submit, is there some other way I could login?

I actually looked into how users log into the site when javascript is disabled, thinking that they may have offered an alternative login route. However, the developers responded with the statement that the site is not functional when the user has javascript disabled. Since this is the case, perhaps this is not even possible with cURL?

Any advice on how I should proceed would be MUCH appreciated, thanks alot!

1个回答


找出AJAX方法提交到的位置。 它可能在表单标签的action参数中,或者可能埋在javascript中。</ p>

您可以使用FireBug或HttpFox之类的firefox扩展程序来观察单击“登录”链接时浏览器的功能。 它可能会生成某种POST请求。 检查该帖子的功能,弄清楚如何通过curl发送等效请求,然后就完成了。</ p>
     </ div>

展开原文

原文

Figure out where the AJAX method submits to. It might be in the action parameter of a form tag, or it could potentially be buried in javascript somewhere.

You could use a firefox extension like FireBug or HttpFox to observe what the browser does when you click the "log in" link. It probably generates some kind of POST request. Examine what that post does, figure out how to send an equivalent request via curl, and you're done.

Csdn user default icon
上传中...
上传图片
插入图片
抄袭、复制答案,以达到刷声望分或其他目的的行为,在CSDN问答是严格禁止的,一经发现立刻封号。是时候展现真正的技术了!
立即提问
相关内容推荐