Jump to content
Sign in to follow this  
Herb191

Need help with _WinHttpSimpleFormFill

Recommended Posts

Herb191

I am trying to use _WinHttpSimpleFormFill to login in to a webpage. This is what I have been trying but it does not return the logged in page content as I expected.

#include "WinHttp.au3"

$sAddress = "rudraweb.com"
$login_page = "program/login.php"
$email = "my_email@some_domain.com"
$password = "some_password"

$hOpen = _WinHttpOpen()
$hConnect = _WinHttpConnect($hOpen, $sAddress)
$sRead = _WinHttpSimpleFormFill($hConnect, $login_page ,"name:loginFrm", "email", $email , "password", $password)

If @error Then
    MsgBox(0,"","Error")
Else
    MsgBox(0, "", $sRead)
EndIf

_WinHttpCloseHandle($hOpen)
_WinHttpCloseHandle($hConnect)
_WinHttpCloseHandle($sRead)

Share this post


Link to post
Share on other sites
trancexx

Can you manually login with that data in your browser?


♡♡♡

.

eMyvnE

Share this post


Link to post
Share on other sites
Herb191

Can you manually login with that data in your browser?

Yes

Edit:

And here is a dummy account you can test it on.

Edit 2:

Removed dummy account info

Edited by Herb191

Share this post


Link to post
Share on other sites
trancexx

It's a bug in my code. I'm interpreting empty action url wrong.

I'll fix it and upload new files if I figure out how to do that LOL.

edit: There. Try 1.6.2.5 version. Link

Thank you for finding a bug.

Edited by trancexx

♡♡♡

.

eMyvnE

Share this post


Link to post
Share on other sites
Herb191

Thank you for finding a bug.

Thank you for fixing it and creating this UDF. This is going to be an extremely useful UDF in meany of my projects....Although now that I know there was a bug I feel a lot better about the four hours before I posted that I spent thinking "there is no way this should be this hard". :D

Edited by Herb191

Share this post


Link to post
Share on other sites
trancexx

Sure. Don't mention it.


♡♡♡

.

eMyvnE

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  

×