Jump to content
Sign in to follow this  

POST with array?

Recommended Posts


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")
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)
While 1
Func _HTTPRequest($oHTTP, $oMethod, $oURL, $oData = "")
    $oHTTP.Open($oMethod, $oURL, False)
    If $oMethod = "POST" Then $oHTTP.SetRequestHeader("Content-Type", "application/x-www-form-urlencoded")
    Return $oHTTP.ResponseText
Func Get()
    MsgBox(0,"",_HTTPRequest($oHTTP, "GET", "http://www.soulraver.net/newchat.php") & @CRLF)

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  


Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.