Jump to content

Recommended Posts

Posted

Hello, I'm creating a browser where I'm trying to send some parameters via POST without success.

#include "IE_EmbeddedVersioning.au3"
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
#include <IE.au3>
#include <array.au3>
#include <WinAPISys.au3>
#include <WindowsConstants.au3>
#include "FunSkin.au3"

Local $hProcMsgBox = DllCallbackRegister("CbtHookProcMsgBox", "int", "int;int;int")
Local $TIDMsgBox = _WinAPI_GetCurrentThreadId()
Local $hHookMsgBox = _WinAPI_SetWindowsHookEx($WH_CBT, DllCallbackGetPtr($hProcMsgBox), 0, $TIDMsgBox)

_FunSkin_Example(@ScriptDir & "/SkinA")

Func _FunSkin_Example($SkinPath)
If $SkinPath <> "" Then
    _FunSkin_Start($SkinPath)
EndIf

_IE_EmbeddedSetBrowserEmulation()

Local $oIE = _IECreateEmbedded()
Local $hGUI = GUICreate("Browser", @DesktopWidth - 20, @DesktopHeight - 90, -1)
Local $GUIActiveX = GUICtrlCreateObj($oIE, 0, 0, @DesktopWidth - 20, @DesktopHeight - 85)

GUISetState() ; Show GUI

Local $url = "http://localhost/Autoit/index-POST.php"
_IENavigate($oIE, $url)
_IELoadWait($oIE)

Local $p1 = "value1"
Local $p2 = "value2"

; Set param
_IEFormElementSetValue(_IEFormElementGetObjByName($oIE, "param1"), $p1)
_IEFormElementSetValue(_IEFormElementGetObjByName($oIE, "param2"), $p2)

; Send form
_IENavigate($oIE, $url, "", "POST", "param1=" & $p1 & "&param2=" & $p2)
_IELoadWait($oIE)

GUISetState()

If $SkinPath <> "" Then
    _FunSkin_Stop()
EndIf

GUIDelete($hGUI)
EndFunc ;==>_FunSkin_Example

My PHP page is not receiving the sent parameters. Can someone help me understand?
First of all, is it possible to send POST parameters?

Error: Incorrect number of parameters in function call

Thanks

  • Moderators
Posted

This is an example script forum, you're looking for general help and support... moving

Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...