Jump to content
Sign in to follow this  
Gravity

HttpWebRequest

Recommended Posts

Gravity

Ok. Soo i changed my mind.. I want to use web request for login in my application . For guys that dont know . I am making application in which you login to application .And you have functions for vip or free . I setuped forum in which you can register . And i want to do when user is logging then it get response from site if id and password is right . Soo this code is right ?

Global $oHTTP = ObjCreate("winhttp.winhttprequest.5.1")

$oHTTP.Open("GET", "testserver.com/login.php", False)

$oHTTP.Send()

$response= $oHTTP.ResponseText

Edited by Gravity

Share this post


Link to post
Share on other sites
JLogan3o13

You're asking if the code is right, which begs the question - have you tried it? If you're having a particular problem with the code, please give us a little more detail as to the error so we can help you troubleshoot.


√-1 2^3 ∑ π, and it was delicious!

Share this post


Link to post
Share on other sites
Gravity

I already don't tried it because i can't access pc and i am asking if this code is right.

Share this post


Link to post
Share on other sites
JLogan3o13

"it don't works" doesn't tell us anything. Are you getting an error? What error checking have you put in place, so you can figure out just where the script fails? At minium you should have something like this:

Global $oHTTP = ObjCreate("winhttp.winhttprequest.5.1")

   If IsObj($oHTTP) Then
       $oHTTP.Open("GET", "testserver.com/login.php", False)
            If @error Then
                MsgBox(0, "", "Error on Open")
            Else
                $oHTTP.Send()
                    If Not @error Then $response= $oHTTP.ResponseText
            EndIf
    EndIf

√-1 2^3 ∑ π, and it was delicious!

Share this post


Link to post
Share on other sites
Gravity

"it don't works" . Mean that i dont get any error. But it doesn't check user login and pass 

Share this post


Link to post
Share on other sites
JLogan3o13

So add that error checking in, and try again.


√-1 2^3 ∑ π, and it was delicious!

Share this post


Link to post
Share on other sites
JLogan3o13

I did, in post #5


√-1 2^3 ∑ π, and it was delicious!

Share this post


Link to post
Share on other sites
Gravity

I am not very good in autoit . Because i am still learning it . But please can someone give me full code ? I know how to do all other things . But i dont get how to create login because there are no tutorials for autoit about this ...

Share this post


Link to post
Share on other sites
JLogan3o13

You're not learning it, you're asking someone to barf up code for you. This should be a couple of steps for you:

  1. Copy the code I have in post #5.
  2. Change the URL to your URL (or post the URL here)
  3. Run the code to see where it errors.

√-1 2^3 ∑ π, and it was delicious!

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.