Jump to content
Sign in to follow this  
fielmann

Login to website with HTTP.UDF

Recommended Posts

fielmann

Hello Autoit-friends!

Login to website with HTTP.UDF

I can't get the website content with _HTTPRead() after sending POST:

#include <HTTP.au3>
$host = "www.inselmacht.de"
$page = "/index.php"
$socket = _HTTPConnect($host)

$get = _HTTPGet($host, $page, $socket)
$recv = _HTTPRead($socket,1)

msgbox(0,"",$recv[4])

$result = StringInStr($recv[4], "PHPSESSID=")
msgbox(0,"position",$result)
$sid = StringMid($recv[4], $result+10, 32)

MsgBox(0, "", $sid)

$page = "/login.php?sid=" & $sid & " login_nick=user123&login_pw=123456&login_game=1&Submit=Zum+Spiel+..."
$num = _HTTPPost($host, $page)
MsgBox(0,"POST " & @error,$num)

$recv = _HTTPRead()
msgbox(0,@error,$recv)

Please check the script and tell me where the problem is. :)

Share this post


Link to post
Share on other sites
fielmann

34 views and no reply ? :)

Has anybody an idea why I can't get the website after POST? :)

Share this post


Link to post
Share on other sites
fielmann

Has nobody an idea 4 my problem ? :D

Share this post


Link to post
Share on other sites
weaponx

What did you use to capture the POST from the browser?

Share this post


Link to post
Share on other sites
fielmann

What did you use to capture the POST from the browser?

why should I capture the POST that I want to send to the server?

I thought that I POST to the server and get back the result with _HTTPread

the first part with _HTTPGet work without problems

Is there a difference in sending a POST-command?

Edited by fielmann

Share this post


Link to post
Share on other sites
Squirrely1

34 views and no reply ? wacko...

Your method of logging-in to a gaming site - conspicuously using non-standard UDF's and determining a Session ID, might lead people to believe you are attempting to hack a website.

First, sign a confession that this is not what you are trying to do, then write an extensive treatise on morality generally, and lastly explain why you are trying to hack this website?

Edited by Squirrely1

Das Häschen benutzt Radar

Share this post


Link to post
Share on other sites
fielmann

Your method of logging-in to a gaming site - conspicuously using non-standard UDF's and determining a Session ID, might lead people to believe you are attempting to hack a website.

First, sign a confession that this is not what you are trying to do, then write an extensive treatise on morality generally, and lastly explain why you are trying to hack this website?

I don't want to hack the site!

I want to build a robot that can build game-items automatictily.

Before I could do this, I have to enter with my account!

Share this post


Link to post
Share on other sites
Squirrely1

There are many topics on the forums that cover logging-in to gaming sites and other sites. At the top of this webpage, toward the right, there is a "Search" link. Click on it and study some results, why not?


Das Häschen benutzt Radar

Share this post


Link to post
Share on other sites
fielmann

There are many topics on the forums that cover logging-in to gaming sites and other sites. At the top of this webpage, toward the right, there is a "Search" link. Click on it and study some results, why not?

Why do you think I have started this case here?

I've already studied the forum before I started it.

Back to the roots: Do you have any technical information for the POST-problem ?

Share this post


Link to post
Share on other sites
Squirrely1

This stuff is well beyond squirrely capability - but if you are wondering about where is the thread where the author of the include file "HTTP.au3", it is at this link.


Das Häschen benutzt Radar

Share this post


Link to post
Share on other sites
fielmann

This stuff is well beyond squirrely capability - but if you are wondering about where is the thread where the author of the include file "HTTP.au3", it is at this link.

I know the link!

Or where do you expect to find informations about HTTP.AU3 - UDF ???

I don't need a link, I need an answer for my POST-question why it does not work in palpable case!

Share this post


Link to post
Share on other sites
fielmann

I know the link!

Or where do you expect to find informations about HTTP.AU3 - UDF ???

I don't need a link, I need an answer for my POST-question why it does not work in palpable case!

any ideas ???

Share this post


Link to post
Share on other sites
aGorilla

Well, I'm not using the same approach, but this is how I'm doing some screen scraping. It may be overkill (I'm too new to tell), but it works:

#include <IE.au3>; browser
#include <GUIConstants.au3>; GUI

Func WebGetPage($url)
  Local $text, $browser, $window, $GUIActiveX
  _IEErrorHandlerRegister()
  $browser = _IECreateEmbedded()
  GUISetState(@SW_HIDE);HIDE GUI
  $window = GUICreate($Config.item('Title_WebGetPage'))
  $GUIActiveX = GUICtrlCreateObj($browser, 1, 1)
  _IENavigate($browser, $url)
  $text = _IEBodyReadHTML($browser)
  $text = StringStripWS($text, 3)
  GUIDelete($window)
  return $text
EndFunc

edit: added 'includes'

Edited by aGorilla

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.