Sign in to follow this  
Followers 0
Herb191

Need help with _WinHttpSimpleFormFill

6 posts in this topic

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



Can you manually login with that data in your browser?


♡♡♡

.

eMyvnE

Share this post


Link to post
Share on other sites

#3 ·  Posted (edited)

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

#4 ·  Posted (edited)

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

#5 ·  Posted (edited)

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

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  
Followers 0