261869247 发表于 2010-9-11 11:01:21

【求助】论坛POST 提交的资料太少了麻烦大家看看这个怎么提交

本帖最后由 261869247 于 2010-9-11 11:36 编辑

#include <ButtonConstants.au3>
#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>

$Form1 = GUICreate("Form1", 351, 133, 429, 352)
$Label1 = GUICtrlCreateLabel("账号", 24, 16, 46, 28)
GUICtrlSetFont(-1, 14, 800, 0, "MS Sans Serif")
GUICtrlSetColor(-1, 0xFF0000)
GUICtrlCreateLabel("", 16, 72, 4, 4)
GUICtrlSetFont(-1, 24, 800, 0, "MS Sans Serif")
GUICtrlSetColor(-1, 0xFF0000)
$Label2 = GUICtrlCreateLabel("密码", 24, 56, 46, 28)
GUICtrlSetFont(-1, 14, 800, 0, "MS Sans Serif")
GUICtrlSetColor(-1, 0xFF0000)
$Input1 = GUICtrlCreateInput("Input1", 80, 16, 209, 21)
$Input2 = GUICtrlCreateInput("Input2", 80, 56, 209, 21)
$Button1 = GUICtrlCreateButton("登陆", 80, 88, 97, 25)
GUICtrlSetFont(-1, 14, 800, 0, "MS Sans Serif")
GUICtrlSetColor(-1, 0x0000FF)
$Button1 = GUICtrlCreateButton("注册账号", 192, 88, 97, 25)
GUICtrlSetFont(-1, 14, 800, 0, "MS Sans Serif")
GUICtrlSetColor(-1, 0x0000FF)
GUISetState()


While 1
        $nMsg = GUIGetMsg()
        Switch $nMsg
                Case -3
                        Exit
                Case $Button1
                        GUISetState(@SW_HIDE, $Form1)
                        $Form2 = GUICreate("Form2", 314, 345, 486, 239)
                        $Label1 = GUICtrlCreateLabel("CS账号", 24, 136, 73, 28)
                        GUICtrlSetFont(-1, 14, 800, 0, "MS Sans Serif")
                        GUICtrlSetColor(-1, 0x0000FF)
                        $Label2 = GUICtrlCreateLabel("CS密码", 24, 56, 73, 28)
                        GUICtrlSetFont(-1, 14, 800, 0, "MS Sans Serif")
                        GUICtrlSetColor(-1, 0x0000FF)
                        $Label3 = GUICtrlCreateLabel("确认密码", 24, 96, 73, 28)
                        GUICtrlSetFont(-1, 14, 800, 0, "MS Sans Serif")
                        GUICtrlSetColor(-1, 0x0000FF)
                        $Button1 = GUICtrlCreateButton("确定注册", 72, 288, 113, 33)
                        $Label4 = GUICtrlCreateLabel("CS中文ID", 24, 176, 73, 28)
                        GUICtrlSetFont(-1, 14, 800, 0, "MS Sans Serif")
                        GUICtrlSetColor(-1, 0x0000FF)
                        $Label5 = GUICtrlCreateLabel("玩家QQ", 24, 16, 73, 28)
                        GUICtrlSetFont(-1, 14, 800, 0, "MS Sans Serif")
                        GUICtrlSetColor(-1, 0x0000FF)
                        $Label6 = GUICtrlCreateLabel("个性签名", 24, 216, 73, 28)
                        GUICtrlSetFont(-1, 14, 800, 0, "MS Sans Serif")
                        GUICtrlSetColor(-1, 0x0000FF)
                        $Input1 = GUICtrlCreateInput("", 104, 16, 169, 21)
                        $Input2 = GUICtrlCreateInput("", 104, 56, 169, 21)
                        $Input3 = GUICtrlCreateInput("", 104, 96, 169, 21)
                        $Input4 = GUICtrlCreateInput("", 104, 136, 177, 21)
                        $Input5 = GUICtrlCreateInput("", 104, 176, 177, 21)
                        $Input6 = GUICtrlCreateInput("", 104, 216, 177, 21)
                        $Button2 = GUICtrlCreateButton("返回登录", 208, 288, 73, 33)
                        GUISetState()

                        While 1
                                $nMsg = GUIGetMsg()
                                Switch $nMsg
                                        Case -3
                                        Exit
                                        Case $Button2
                                                GUISetState(@SW_HIDE, $Form2)
                                                GUISetState(@SW_SHOW, $Form1)
                                                ExitLoop
                                EndSwitch
                        WEnd


        EndSwitch
WEnd看看这个站点怎么提交 是我自己的
登录http://121.8.187.110:8181/
注册http://121.8.187.110:8181/reg.php
大家帮我看看怎么post提交登陆 和注册
登陆和注册的时候都不要打开IE 直接返回信息
登陆的时候提示登录成功
注册的时候能msgbox 提示所有的返回信息就好了
我把返回的提示都贴出来
登录不成功只有一个提示 :
用户名或密码不对!
注册的时候下列提示都要获取到
用户名已存在,请选择另一个!
中文ID已存在,请选择另一个!
用户名不能为空!
密码不能为空!
两次输入密码不一至!
CS中文ID不能为空!
QQ不能为空!

.個朲綉√ 发表于 2010-9-11 15:31:29

本帖最后由 .個朲綉√ 于 2010-9-13 00:51 编辑

Sorry技术不到家,555,关注一下,等高手吧。
不知道哪出错了,请高手再改进吧,试了半天没通过,郁闷。
可能是没有Cookie吧,我抓包没有抓到Cookie

#include <ButtonConstants.au3>
#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>

$Form1 = GUICreate("登陆", 351, 133, 429, 352)
$Label1 = GUICtrlCreateLabel("账号", 24, 16, 46, 28)
GUICtrlSetFont(-1, 14, 800, 0, "MS Sans Serif")
GUICtrlSetColor(-1, 0xFF0000)
GUICtrlCreateLabel("", 16, 72, 4, 4)
GUICtrlSetFont(-1, 24, 800, 0, "MS Sans Serif")
GUICtrlSetColor(-1, 0xFF0000)
$Label2 = GUICtrlCreateLabel("密码", 24, 56, 46, 28)
GUICtrlSetFont(-1, 14, 800, 0, "MS Sans Serif")
GUICtrlSetColor(-1, 0xFF0000)
$Input1 = GUICtrlCreateInput("Name", 80, 16, 209, 21)
$Input2 = GUICtrlCreateInput("Pass", 80, 56, 209, 21)
$Button1 = GUICtrlCreateButton("登陆", 80, 88, 97, 25)
GUICtrlSetFont(-1, 14, 800, 0, "MS Sans Serif")
GUICtrlSetColor(-1, 0x0000FF)
$Button2 = GUICtrlCreateButton("注册账号", 192, 88, 97, 25)
GUICtrlSetFont(-1, 14, 800, 0, "MS Sans Serif")
GUICtrlSetColor(-1, 0x0000FF)
GUISetState()


While 1
      $nMsg = GUIGetMsg()
      Switch $nMsg
                Case -3
                        Exit
                                        Case $Button1
                                                _login(GUICtrlRead($Input1),GUICtrlRead($Input2))
                Case $Button2
                        GUISetState(@SW_HIDE, $Form1)
                        $Form2 = GUICreate("账号注册", 314, 345, 486, 239)
                        $Label1 = GUICtrlCreateLabel("中文ID", 24, 136, 73, 28)
                        GUICtrlSetFont(-1, 14, 800, 0, "MS Sans Serif")
                        GUICtrlSetColor(-1, 0x0000FF)
                        $Label2 = GUICtrlCreateLabel("密码", 24, 56, 73, 28)
                        GUICtrlSetFont(-1, 14, 800, 0, "MS Sans Serif")
                        GUICtrlSetColor(-1, 0x0000FF)
                        $Label3 = GUICtrlCreateLabel("确认", 24, 96, 73, 28)
                        GUICtrlSetFont(-1, 14, 800, 0, "MS Sans Serif")
                        GUICtrlSetColor(-1, 0x0000FF)
                        $Button3 = GUICtrlCreateButton("确定注册", 72, 288, 113, 33)
                        $Label4 = GUICtrlCreateLabel("QQ号", 24, 176, 73, 28)
                        GUICtrlSetFont(-1, 14, 800, 0, "MS Sans Serif")
                        GUICtrlSetColor(-1, 0x0000FF)
                        $Label5 = GUICtrlCreateLabel("账号", 24, 16, 73, 28)
                        GUICtrlSetFont(-1, 14, 800, 0, "MS Sans Serif")
                        GUICtrlSetColor(-1, 0x0000FF)
                        $Label6 = GUICtrlCreateLabel("签名", 24, 216, 73, 28)
                        GUICtrlSetFont(-1, 14, 800, 0, "MS Sans Serif")
                        GUICtrlSetColor(-1, 0x0000FF)
                        $Input1 = GUICtrlCreateInput("", 104, 16, 169, 21)
                        $Input2 = GUICtrlCreateInput("", 104, 56, 169, 21)
                        $Input3 = GUICtrlCreateInput("", 104, 96, 169, 21)
                        $Input4 = GUICtrlCreateInput("", 104, 136, 177, 21)
                        $Input5 = GUICtrlCreateInput("", 104, 176, 177, 21)
                        $Input6 = GUICtrlCreateInput("", 104, 216, 177, 21)
                        $Button4 = GUICtrlCreateButton("返回登录", 208, 288, 73, 33)
                        GUISetState()

                        While 1
                              $nMsg = GUIGetMsg()
                              Switch $nMsg
                                        Case -3
                                        Exit
                                        Case $Button4
                                                GUISetState(@SW_HIDE, $Form2)
                                                GUISetState(@SW_SHOW, $Form1)
                                                ExitLoop
                                                                                Case $GUI_EVENT_CLOSE
                                                                                Exit
                                                                                Case $Button3
                                                                                _reg(GUICtrlRead($Input1),GUICtrlRead($Input2),GUICtrlRead($Input4),GUICtrlRead($Input5),GUICtrlRead($Input6))
                              EndSwitch
                        WEnd


      EndSwitch
        WEnd

Func _login($name,$pass)
$xmlhttp=ObjCreate("Microsoft.XMLHTTP")
$xmlhttp.open("post","http://121.8.187.110:8181/login.php?action=login",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://121.8.187.110:8181/index.php")
$xmlhttp.Send("auth="& $name &"password=" & $pass & "Submit.x=20&Submit.y=17")
ShellExecute("http://121.8.187.110:8181/index.php")
EndFunc

Func _reg($name,$pass,$cnid,$qq,$gx)
$oHTTP = ObjCreate("microsoft.xmlhttp")
$oHTTP.Open("post","http://121.8.187.110:8181/reg.php?action=adduser",false)
$oHTTP.setRequestHeader("Cache-Control", "no-cache")
$oHTTP.setRequestHeader("Content-Type","application/x-www-form-urlencoded")
$oHTTP.setRequestHeader("Referer","http://121.8.187.110:8181/reg.php")
$oHTTP.setRequestHeader("Content-Length","115")
$oHTTP.Send("auth="& $name & "password=" & $pass & "password2=" & $pass & "cnid=" & $cnid & "qq=" & $qq & "sing="& $gx & "Submit=%C8%B7%B6%A8%D7%A2%B2%E1")
ShellExecute("http://121.8.187.110:8181/index.php")
EndFunc

261869247 发表于 2010-9-11 15:45:43

先占个位,最近在学Post帮你试试。
.個朲綉√ 发表于 2010-9-11 15:31 http://www.autoitx.com/images/common/back.gif


    谢谢你啊!

republican 发表于 2010-9-11 18:26:58

本帖最后由 republican 于 2010-9-11 18:32 编辑

简单的试了一下,POST的话应该没什么难度。

请LZ说清楚自己想要干嘛!

这个程序是想登录后打开网页还是全后台?

前者别问我。

全后台的话,LZ还需给出服务器在不同情况下返回的数据特点。


不然要人自己摸索得话,纯粹只是个苦力活。

261869247 发表于 2010-9-11 20:40:24

简单的试了一下,POST的话应该没什么难度。

请LZ说清楚自己想要干嘛!

这个程序是想登录后打开网页还 ...
republican 发表于 2010-9-11 18:26 http://www.autoitx.com/images/common/back.gif

登陆的时候 就一个作用 判断玩家账号密码是否正确 如果正确就给个提示 不正确就提示账号密码错误
注册的直接在GUI 界面注册
很方便不用打开网页注册了

就这点功能!

republican 发表于 2010-9-11 22:58:12

试了半天,没登陆上。

算了,不试了。

不知道这些值从哪来的
Submit.x=
Submit.y=

261869247 发表于 2010-9-11 23:47:01

试了半天,没登陆上。

算了,不试了。

不知道这些值从哪来的
Submit.x=
Submit.y=
republican 发表于 2010-9-11 22:58 http://www.autoitx.com/images/common/back.gif

这个网站是我做的 我可以提供下 login.php index.php reg.php 给你

261869247 发表于 2010-9-12 13:26:35

继续等待 现在注册暂时不需要POST 提交了 看看登陆那里怎么提交 期待高手出现!

.個朲綉√ 发表于 2010-9-13 00:52:53

试了半天,没登陆上。

算了,不试了。

不知道这些值从哪来的
Submit.x=
Submit.y=
republican 发表于 2010-9-11 22:58 http://www.autoitx.com/images/common/back.gif


是的,我抓了几次包,这二个数据貌似是判断鼠标点击位置,Post不了。
Submit.x=
Submit.y=

261869247 发表于 2010-9-13 16:33:15

我重新写了PHP 大家帮我看看这个怎么提交 一句话提交
http://121.8.187.110:8181/test/login.php 账号123456 密码123456
如果可以一句话提交 AU3 就可以直接获取提交后的网页信息 来判断玩家是否登录成功

liufenglg 发表于 2010-9-13 16:54:41

是自动登陆?

261869247 发表于 2010-9-13 17:20:29

是自动登陆?
liufenglg 发表于 2010-9-13 16:54 http://www.autoitx.com/images/common/back.gif


    恩 一句代码自动登录的
http://121.8.187.110:8181/test/login.php
账号123456 密码123456
这个地址也可以这样吗?

republican 发表于 2010-9-13 18:25:53

这个就变成Get了哦...

直接读取http://121.8.187.110:8181/test/check.php?auth=123456&password=123456

这个地址就行了。

261869247 发表于 2010-9-13 18:55:45

本帖最后由 261869247 于 2010-9-13 18:57 编辑

现在可以了我把check.php 的 _post 改成_get 了

republican 发表于 2010-9-14 16:47:26

回复 14# 261869247

我还是想知道,
Submit.x=
Submit.y=
是怎么算出来的?原理是?
页: [1] 2
查看完整版本: 【求助】论坛POST 提交的资料太少了麻烦大家看看这个怎么提交