Dashier sollte funktionieren.
PHP Code:
#include <ButtonConstants.au3>
#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>
#include <WinHttp.au3>
Global $nLogin = False
#Region ### START Koda GUI section ### Form=
$Form1 = GUICreate("Treasure", 227, 327, 363, 462)
$ID = GUICtrlCreateLabel("ID", 8, 16, 15, 17)
$Label1 = GUICtrlCreateLabel("PW", 8, 40, 22, 17)
$Label2 = GUICtrlCreateLabel("Treasure Name:", 8, 96, 80, 17)
$Input1 = GUICtrlCreateInput("", 32, 16, 121, 21)
$Input2 = GUICtrlCreateInput("", 32, 40, 121, 21, $ES_PASSWORD)
$Label3 = GUICtrlCreateLabel("Treasure Content", 8, 120, 86, 17)
$Label4 = GUICtrlCreateLabel("Treasure Cost", 8, 144, 70, 17)
$Input3 = GUICtrlCreateInput("", 96, 96, 121, 21)
$Input4 = GUICtrlCreateInput("", 96, 120, 121, 21)
$Input5 = GUICtrlCreateInput("", 96, 144, 121, 21)
$Label5 = GUICtrlCreateLabel("", 8, 64, 175, 17)
$Button1 = GUICtrlCreateButton("Login", 8, 176, 99, 25, $WS_GROUP)
$Button2 = GUICtrlCreateButton("Create Treasure", 120, 176, 99, 25, $WS_GROUP)
$Edit1 = GUICtrlCreateEdit("", 8, 208, 209, 113)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###
While 1
$nMsg = GUIGetMsg()
Switch $nMsg
Case $GUI_EVENT_CLOSE
If $nLogin = True Then
_WinHttpCloseHandle($hSession)
_WinHttpCloseHandle($hConnect)
EndIf
Exit
Case $Button1
$hSession = _WinHttpOpen("Mozilla/5.0 (Windows NT 6.0; rv:10.0.1) Gecko/20100101 Firefox/10.0.1")
$hConnect = _WinHttpConnect($hSession, "www.elitepvpers.com")
$sHTML = _WinHttpSimpleRequest($hConnect, "POST", "forum/login.php?do=login", "", "vb_login_username=" & GUICtrlRead($Input1) & "&vb_login_password=" & GUICtrlRead($Input2) & "&cookieuser=1&s=&securitytoken=guest&do=login")
If StringInStr($sHTML, "<strong>Thank you for logging in, ") Then
GUICtrlSetData($Label5,"Login successful!")
GUICtrlSetData($Edit1,"Login successful"&@CRLF, "1")
$nLogin = True
Else
MsgBox(0,"Login failed","Login failed!")
GUICtrlSetData($Label5,"Login failed!")
EndIf
Case $Button2
If $nLogin = True Then
$sHTML = _WinHttpSimpleRequest($hConnect, "POST", "theblackmarket/treasures/", "","title="&GUICtrlRead($Input3)&"&content="&GUICtrlRead($Input4)&"&cost="&GUICtrlRead($Input5)&"&createtreasure=Submit")
GUICtrlSetData($Edit1,"Treasure created!"&@CRLF, "1")
Else
MsgBox(0,"Not logged in!","You have to login")
EndIf
EndSwitch
WEnd