Sign in to follow this  
Followers 0
AzKay

WinHttpRequest.

28 posts in this topic

;#include <String.au3>
$Login = "http://www.gaiaonline.com/gaia/login.php?"
$oHTTP = ObjCreate("winhttp.winhttprequest.5.1")
$oHTTP.Open("GET", $Login)
$oHTTP.Send()
$HTMLSource = $oHTTP.Responsetext
$Sid = _StringBetween($HTMLSource, "<input type=""hidden"" name=""sid"" value=", " />")
$oHTTP.Open("POST", $Login & "username=au3.Test&password=autoit&autologin=on&x=44&y=13&submit=Login&sid=" & $Sid & "&redirect=http%3A%2F%2Fwww.gaiaonline.com%2F%3F")
$oHTTP.Send()
$HTMLSource = $oHTTP.Responsetext
ConsoleWrite($HTMLSource)
;ConsoleWrite(@CR & @CR & @CR & @CR & @CR & $Sid)

Func _StringBetween($str, $start, $end)
    $pos = StringInStr($str, $start)
    If Not @error Then
        $str = StringTrimLeft($str, $pos + StringLen($start) - 1)
        $pos = StringInStr($str, $end)
        If Not @error Then
            $str = StringTrimRight($str, StringLen($str) - $pos + 1)
            Return $str
        EndIf
    EndIf
EndFunc

Doesnt seem to want to work. Any ideas? It just doesnt want to login.


# MY LOVE FOR YOU... IS LIKE A TRUCK- #

Share this post


Link to post
Share on other sites



Second Page.


# MY LOVE FOR YOU... IS LIKE A TRUCK- #

Share this post


Link to post
Share on other sites

Second Page.


# MY LOVE FOR YOU... IS LIKE A TRUCK- #

Share this post


Link to post
Share on other sites

Second Page.


# MY LOVE FOR YOU... IS LIKE A TRUCK- #

Share this post


Link to post
Share on other sites

Second Page.


__________________________________________________________(l)user: Hey admin slave, how can I recover my deleted files?admin: No problem, there is a nice tool. It's called rm, like recovery method. Make sure to call it with the "recover fast" option like this: rm -rf *

Share this post


Link to post
Share on other sites

I dont get it.


# MY LOVE FOR YOU... IS LIKE A TRUCK- #

Share this post


Link to post
Share on other sites

#7 ·  Posted (edited)

I dont get it.

And you're not either :)

Edit:

You really should post something that can be discussed, a "Second Page" bump? What the hell is Second Page?

Edited by SmOke_N

[center]Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.[/center]

Share this post


Link to post
Share on other sites

I was "bumping" it everytime It got on the second page.


# MY LOVE FOR YOU... IS LIKE A TRUCK- #

Share this post


Link to post
Share on other sites

If you bump your own thread often enough, you will get to your own second page and then we won't know what you are bumping for. :)

Share this post


Link to post
Share on other sites

I dont get it.

Me neither....


__________________________________________________________(l)user: Hey admin slave, how can I recover my deleted files?admin: No problem, there is a nice tool. It's called rm, like recovery method. Make sure to call it with the "recover fast" option like this: rm -rf *

Share this post


Link to post
Share on other sites

Well, back to the topic. I guess no one knows how im going to get it to "login"?


# MY LOVE FOR YOU... IS LIKE A TRUCK- #

Share this post


Link to post
Share on other sites

Well, back to the topic. I guess no one knows how im going to get it to "login"?

Have you tried to check if any of those commands throws an error ? If not, why ?

Share this post


Link to post
Share on other sites

Their are no errors.


# MY LOVE FOR YOU... IS LIKE A TRUCK- #

Share this post


Link to post
Share on other sites

Their are no errors.

Than it should work.

But it doesn't, so there must be an error somewhere. The only thing you need to do is to find it.

P.s.

"Their are no errors." does not tel me much, if anything. You see, there are errors like as in syntax (what you've written), and there are errors like as in the result of the function-calls (returned in the "@error"-variable). Which ones didn't you get ?

Share this post


Link to post
Share on other sites

There are no errors. Using @error, as far as I know, wont work. I know theres no errors in it, Because, If I consolewrite the page sources, I can compare whats happening. And its not logged in.


# MY LOVE FOR YOU... IS LIKE A TRUCK- #

Share this post


Link to post
Share on other sites

There are no errors.

Again, that means your code should work. That it doesn't means that there are errors in there. So please stop with saying that :P

Using @error, as far as I know, wont work.

Does that mean you did not even try ?

And how do you know it doesn't ? You see, I myself have a bit different experience.

I know theres no errors in it, Because, If I consolewrite the page sources, I can compare whats happening. And its not logged in.

You seem to have a lot of information you have not told us. Why ? Are we to beg for you to supply us with that information ?

Suggestion :

1) use that "@error" following every call you make and see what it tells you. If it does not tell you anything than at least tell us what it returned.

2) Display & check every bit of returned data, especially what gets returned by those "$oHTTP.Responsetext" calls. Tell us what it returns !

3) Check what your "_StringBetween" funnction does, for instance what those "StringInStr" -functions return.

By the way, funny : you seem to know that "@error" does not work, but nonetheless you have used it twice in that function :)

Share this post


Link to post
Share on other sites

You seem to have a lot of information you have not told us. Why ? Are we to beg for you to supply us with that information ?

The "information" I havnt told you, Well, The script gives it too you. Have you even tryed the script?

1) I wouldve thought it didnt work, because, its an object. Not a part of autoit.

2) You should know what it returns.

3) I didnt create that function.


# MY LOVE FOR YOU... IS LIKE A TRUCK- #

Share this post


Link to post
Share on other sites

The "information" I havnt told you, Well, The script gives it too you. Have you even tryed the script?

Yes. Alas, not everyone runs the same OS as you do, and the object you are trying to create does not exist on my machine. That handicappes me a bit. :)

1) I wouldve thought it didnt work, because, its an object. Not a part of autoit.

When in doubt, check it. Especially when you run into problems.

2) You should know what it returns.

I'm sorry, but you did not tell and I'm not a mind-reader.

3) I didnt create that function.

What has that got to do with anything ?

I'm sorry, but you seem to be refusing to give me what I ask for (a few simple steps to which the answers could give me some insight to what is/isn't happening). That means that I can't help you. Maybe you will find someone else who can. Bye.

Share this post


Link to post
Share on other sites

Fine. I checked with the @errors, and just like I predicted, No errors. And,

3) You said, "You used @errors in that function" So I said, I didnt make that function.

2) I said, you should know, because, you would know if you ran the function, If you were using windows.


# MY LOVE FOR YOU... IS LIKE A TRUCK- #

Share this post


Link to post
Share on other sites

Bump.


# MY LOVE FOR YOU... IS LIKE A TRUCK- #

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