Jump to content
Sign in to follow this  
Faustvii

web login confirmation

Recommended Posts

Faustvii

Func _AccessAdmin()
    $oIE = _IECreate("http://127.0.0.1")
    $oForm = _IEFormGetCollection($oIE, 0)
    $oUserField = _IEFormElementGetCollection($oForm, 0)
    $oPassField = _IEFormElementGetCollection($oForm, 1)
    _IEFormElementSetValue($oUserField, "Username")
    _IEFormElementSetValue($oPassField, "Password")
    $LoginCheck = _IEFormSubmit($oForm)
    If $LoginCheck = -1 Then
        _IENavigate($oIE, "https://127.0.0.1/admin.htm")
    Else
        _IEQuit($oIE)
    EndIf
EndFunc   ;==>_AccessAdmin

What i want to check is if it successfully login, for instance if the password is wrong it would not login but it seems that the IEFormSubmit still returns -1(success) when the password or username is wrong.

Share this post


Link to post
Share on other sites
notsure

I always pick a string from the _IEBodyReadHTML function which is unique on the page after you've been logged in succesfully.

Share this post


Link to post
Share on other sites
Faustvii

Thanks, Got it working :mellow:

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  

×