我正在尝试使用cURL(cURL的首次使用者)登录网站www.centralgreen.com.sg/login.PHP
我使用了Firefox的Tamper插件,我有4个POST输入:
login=mylogin password=mypassword Button_DoLogin.x=33 Button_DoLogin.y=6
我试着再次使用curl
curl.exe --data 'login=mylogin&password=mypassword&Button_DoLogin.x=33&Button_DoLogin.y=6' www.centralgreen.com.sg/login.PHP?ccsForm=Login
但是登录显然没有通过(此命令的输出是相同的形式,只填充了密码,并且出现错误消息“用户名”字段中的值是必需的.)
以下是我从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表单传递登录信息?
解决方法
尝试使用-F选项而不是–data.
http://curl.haxx.se/docs/manpage.html#-F
Content-Type: multipart/form-data
这可能会给你一个更好的结果.