登录POST表单和cURL [英] login POST form with cURL
问题描述
我想使用cURL(cURL的第一次使用者)登入网站www.centralgreen.com.sg/login.php
I am trying to login to the website www.centralgreen.com.sg/login.php using cURL (first time user of cURL)
我使用篡改plugin for Firefox,我有4个POST输入:
I used the Tamper plugin for Firefox, and I have 4 POST inputs:
login=mylogin
password=mypassword
Button_DoLogin.x=33
Button_DoLogin.y=6
我试图再次使用curl, / p>
I tried to use curl again using
curl.exe --data 'login=mylogin&password=mypassword&Button_DoLogin.x=33&Button_DoLogin.y=6' www.centralgreen.com.sg/login.php?ccsForm=Login
但是登录显然没有 t通过(此命令的输出是相同的形式,只填充密码,并显示错误消息字段用户名中的值)
But the login apparently doesn't go through (the output of this command is the same form, filled with only the password, and an error message The value in field Username is required.)
这是我从Tamper获得的信息的完整列表
Here is the full list of info I get from Tamper
Host centralgreen.com.sg
User-Agent Mozilla/5.0 (Windows NT 5.1; rv:2.0) Gecko/20100101 Firefox/4.0
Accept text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
Accept Language en-us,en;q=0.5
Accept Encoding gzip, deflate
Accept Charset ISO-8859-1,utf-8;q=0.7,*;q=0.7
Keep Alive 115
Connection keep-alive
Referer http://centralgreen.com.sg/login.php
Cookie PHPSESSID=65fbxxxxxxx02694e3a72xxxxxxxx; Valley_ParkLogin=04E203A459FCxxxxxxxA2DCD9AAE5B9678G08C04F1952155E2482xxxxxxxxxxxxx
有什么我做错了吗?如何通过POST表单传递登录信息?
Is there anything I do wrong? How can I pass the login through the POST form?
推荐答案
尝试使用 -F
选项而不是 - data
。
Try using the -F
option instead of --data
.
http:// curl .haxx.se / docs / manpage.html#-F
基本上,这会将内容类型标题更改为:
Basically, this changes the content type header to:
Content-Type: multipart/form-data
$ b b
这可能会给你一个更好的结果。
This may give you a better result.
这篇关于登录POST表单和cURL的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!