Sign in to follow this  
Followers 0
Vindicator209

POST with array?

1 post in this topic

#1 ·  Posted (edited)

Hmm, so I'm trying to make my script login to a website, but I don't know how to send multiple things, since this function only has 1 parameter for data, and I try using an array but it didn't quite work out:

$oHTTP = ObjCreate("winhttp.winhttprequest.5.1")
;Login("SRbot","1234bot")
Dim $var[2][2]
$var[0][0] = "loginname"
$var[0][1] = "SRBot"
$var[1][0] = "password"
$var[1][1] = "abc123"
_HTTPRequest($oHTTP, "POST", "http://www.soulraver.net/login.php",$var)
HotKeySet("{INS}","Get")
While 1
    Sleep(1000)
WEnd
Func _HTTPRequest($oHTTP, $oMethod, $oURL, $oData = "")
    $oHTTP.Open($oMethod, $oURL, False)
    If $oMethod = "POST" Then $oHTTP.SetRequestHeader("Content-Type", "application/x-www-form-urlencoded")
    $oHTTP.Send($oData)
    Return $oHTTP.ResponseText
EndFunc
Func Get()
    MsgBox(0,"",_HTTPRequest($oHTTP, "GET", "http://www.soulraver.net/newchat.php") & @CRLF)
EndFunc

Then my friend who already did this in perl told me to try this(which doesn't work):

$var["loginname"] = "SRBot"

$var["password"] = "123abc"

_HTTPRequest($oHTTP, "POST", "http://www.soulraver.net/login.php",$var)

I have to send both the username and password at the same time, along with which is which... but i dont know how I would do that...

Any help? Thanks. I didn't want to use the other thread cause this is a different problem and such..yeah...

Edited by VindicatorOmega

[center]"When you look at old, classic games like Snake, you often put it off because it's such a simple game, but it's only when you actually try and create your own unique game from scratch, do you finally appreciate those games."[/center][center]Don't ask for answers if you haven't TRIED yet![/center][center]Most answers can be answered in the help file! Use it![/center]

Share this post


Link to post
Share on other sites



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
Sign in to follow this  
Followers 0