omegabomb 发表于 2010-4-13 22:51:39

请教网页POST登陆的问题

我想登陆http://u.115.com这个网页,用httpwatch截取的如下:

POST /?action=login&goto=http%3A%2F%2Fu.115.com%2F%3Fac%3Dmy HTTP/1.1
Accept: */*
Referer: http://u.115.com/
Accept-Language: zh-cn
Content-Type: application/x-www-form-urlencoded
Accept-Encoding: gzip, deflate
User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1)
Host: my.115.com
Content-Length: 58
Connection: Keep-Alive
Cache-Control: no-cache
Cookie: LCCK=isucko%40126.com; PHPSESSID=21aeef9f340b4d73789d5c4088e2898b

login%5Baccount%5D=isucko@126.com&login%5Bpasswd%5D=123456

怎么通过post提交数据?

omegabomb 发表于 2010-4-14 08:39:29

我搜索了一下论坛,下面这段代码运行了,没反应,不知哪里错了?$xmlhttp=ObjCreate("Microsoft.XMLHTTP")
$poststr="login%5Baccount%5D=isucko@126.com&login%5Bpasswd%5D=123456"
$xmlhttp.open("post","http://u.115.com/?action=login&goto=http%3A%2F%2Fu.115.com%2F%3Fac%3Dmy",false)
$xmlhttp.setRequestHeader("Cache-Control", "no-cache")
$xmlhttp.setRequestHeader("Content-Type","application/x-www-form-urlencoded")
$xmlhttp.setRequestHeader("Referer","http://u.115.com")
$xmlhttp.send($poststr)

omegabomb 发表于 2010-4-14 11:30:29

有人在吗?

autoit3CN 发表于 2010-4-28 03:17:32

查看一下返回值啊

wuweixian 发表于 2010-4-28 05:45:59

:face (31):

ghl781258 发表于 2010-4-28 19:22:28

用httpwatch软件看post值的stream部分,一句代码搞定自动提交

lynfr8 发表于 2010-4-28 22:59:25

$xmlhttp=ObjCreate("Microsoft.XMLHTTP")
$poststr="login%5Baccount%5D=isucko@126.com&login%5Bpasswd%5D=123456&login%5Btime%5D=on"
$xmlhttp.open("post","http://my.115.com/?action=login&goto=http%3A%2F%2Fmy.115.com",false)
$xmlhttp.setRequestHeader("Cache-Control", "no-cache")
$xmlhttp.setRequestHeader("Connection", "Keep-Alive")
$xmlhttp.setRequestHeader("Content-Type","application/x-www-form-urlencoded")
$xmlhttp.setRequestHeader("Referer","http://my.115.com/")
$xmlhttp.setRequestHeader("Cookie","AACK=MTI3MjQ2NjY0OHxiZTk5ZjdkNTg4MmI5NzlmYTUwMGI1NGQ5NzY3M2ExZQ%3D%3D")
$xmlhttp.send($poststr)
ShellExecute("http://my.115.com/")

aayes 发表于 2010-6-7 22:40:18

好东西,正是我所想要的,呵呵
页: [1]
查看完整版本: 请教网页POST登陆的问题