Jump to content


Photo

Http Dll


  • Please log in to reply
67 replies to this topic

#1 Maarten Baert

Maarten Baert

    GMC Member

  • GMC Member
  • 750 posts
  • Version:GM8.1

Posted 04 March 2009 - 06:29 PM

This DLL is discontinued. There's a more recent version of this DLL here:
http://gmc.yoyogames...howtopic=509556


This DLL allows you to use the HTTP 1.0 protocol in your games. You can set the method, filename, headers and message body. The DLL uses a thread to take care of the downloading, so you can do whatever you want in your game while the download is running. The DLL supports up to 16 HTTP connections at the same time.

So what's so good about this? The same can be done with 39dll. True, but if you have ever tried this, you will notice it isn't that easy. GM's string functions are very limited (and slow), so it will be very hard to read headers, for example. Furthermore, as this DLL uses a thread to handle the socket connections, the downloads will run a lot faster as the thread can check them a lot faster than the game can. The DLL supports the entire HTTP/1.0 protocol (for receiving, for sending you can use HTTP/1.1 if the server supports it). The DLL should work with all types of servers. This DLL is like a combination of 39dll, Download Manager, Netread Dll and HTTP request dll.

You can:
- download multiple files at once (like Download Manager)
- read downloaded files directly (like Netread Dll)
- send HTTP requests (like HTTP request dll)
- ...
And all this can be done at the same time.

Download: HTTP Dll - ZIP (58.4kb)
Contains scripts, extension, an example (gmk) and a help file.

Source code: Download

Edited by Maarten Baert, 29 July 2011 - 07:27 PM.

  • 0
Posted Image

#2 blackhawkrobbo

blackhawkrobbo

    GMC Member

  • GMC Member
  • 1121 posts
  • Version:GM:Studio

Posted 04 March 2009 - 10:39 PM

YES!
Thank you.
Its WAY better than NetRead! While netread is even more popular.. Its better than Download Manager from hobbl too.
This one WORKS!

netread has the irritating maximum bytes stuff, + it doesn't work after a random amounts of times being used, and the downloadmanager simply sucks.

Thanks a lot!
Do you want credits for this? I'm going to use it in men of war 2 :)
  • 0

#3 Maarten Baert

Maarten Baert

    GMC Member

  • GMC Member
  • 750 posts
  • Version:GM8.1

Posted 05 March 2009 - 04:06 PM

I'm glad you like it :blink:. Credits are not required.
  • 0
Posted Image

#4 Prefix

Prefix

    GMC Member

  • New Member
  • 38 posts

Posted 06 March 2009 - 06:05 PM

Could you give a simple POST example?

I've tried dissecting your code, but I can't get a simple POST working.

Thanks

EDIT: Yeah ok, I've got pretty close now, but what is this crlf and lf stuff?

I can't see where you have defined it in your example.

Edited by Prefix, 06 March 2009 - 09:10 PM.

  • 0

#5 Maarten Baert

Maarten Baert

    GMC Member

  • GMC Member
  • 750 posts
  • Version:GM8.1

Posted 06 March 2009 - 09:07 PM

Could you give a simple POST example?

I've tried dissecting your code, but I can't get a simple POST working.

Thanks


POST is really simple. Just copy the code in the netread script, then:
- replace GET by POST
- add a message body. The message body looks like this: (almost identical to GET, actually)
data = http_urlencode(name1,false)+'='+http_urlencode(value1,false)+'&'+http_urlencode(name2,false)+'='+http_urlencode(value2,false);
http_set_message_body_in(http,data);
- add these headers:
http_set_headers_in(http,
'Content-Type: application/x-www-form-urlencoded'+crlf+
'Content-Length: '+string(string_length(data))+crlf
);

  • 0
Posted Image

#6 008008

008008

    GMC Member

  • New Member
  • 45 posts

Posted 01 July 2009 - 08:17 PM

This is EXCELLENT! :huh:
I have been looking for a better download dll and this one is perfect!

Thanks
  • 0

I am 5,6,7 registered!
GMC Member Since '06


#7 IceMetalPunk

IceMetalPunk

    InfiniteIMPerfection

  • GMC Elder
  • 9603 posts
  • Version:GM:Studio

Posted 01 July 2009 - 09:55 PM

Very nice. I might use this, if I can find a use for it in Blastix ::lmao:: .

-IMP :) :huh:
  • 0

:GM123: Are you an artist who likes creating original creature designs? Maybe you can help out with Elementa here! Give it a look; you might like the idea :)

:bunny: :excl: :bunny: :excl: :bunny: :excl: :bunny: :excl: :bunny: :excl: :bunny: :excl: :bunny: :excl: :bunny: :excl: :bunny: :excl: :bunny:


#8 Poddington

Poddington

    Lucky To Reach 30

  • GMC Member
  • 267 posts

Posted 13 September 2009 - 10:25 AM

Hey, i have been playing around with the dll and i think this is exactly what i was looking for, thanks for the hard work.
  • 0

#9 alsbtain

alsbtain

    GMC Member

  • New Member
  • 2 posts

Posted 15 September 2009 - 03:00 AM

u r awesome !!!

this is my need ...!!

but i have a question ...

How can i get body into variable without show message ???

thanks ..
  • 0

#10 Krisando

Krisando

    GMC Member

  • New Member
  • 1351 posts

Posted 15 October 2009 - 10:11 AM

Can you download multiple files procedural? One after another, thats been a major bug in the other GM downloaders i've tried.
  • 0

Posted Image


#11 Maarten Baert

Maarten Baert

    GMC Member

  • GMC Member
  • 750 posts
  • Version:GM8.1

Posted 15 October 2009 - 08:20 PM

Yes you can, but you have to do that manually. Downloading sequentially is actually a lot easier than downloading simultaneously :). It this what you mean?
  • 0
Posted Image

#12 slayer 64

slayer 64

    Slayer of gingers

  • GMC Member
  • 4301 posts
  • Version:GM:Studio

Posted 15 October 2009 - 11:44 PM

this is really nice. good job!
  • 0

5y5rs3d.pngfg0UQNL.png


#13 Krisando

Krisando

    GMC Member

  • New Member
  • 1351 posts

Posted 16 October 2009 - 10:55 AM

Yes thats exactly what I meant, does it supprt bytes/max_bytes or %? Status of download?
  • 0

Posted Image


#14 Maarten Baert

Maarten Baert

    GMC Member

  • GMC Member
  • 750 posts
  • Version:GM8.1

Posted 16 October 2009 - 11:24 AM

Yes it does.
// step event
message_body_length = http_get_message_body_length(http);
a = string_digits(http_get_header_value(http,'content-length'));
if a!='' {
content_length = real(header_content_length);
} else {
content_length = 0;
}

// draw event
if content_length!=0 {
draw_text(x+610,y+380,'Progress: '+string(floor(100*message_body_length/content_length))+'%');
}

Servers will only send the content-length header if the file you are downloading is static (not dynamic, like php scripts).

About the status of download, I'm not sure what you mean:
conn_status = http_get_conn_status(http); // 0=not connected / 1=connected / 2=closed / 3=disconnected
action = http_get_action(http); // 0=waiting for statuscode / 1=receiving headers / 2=receiving message body
statuscode = http_get_statuscode(http); // HTTP status code, for example 200 (OK), 404 (not found), ...
The download has completed when conn_status=2 and action=2.
  • 0
Posted Image

#15 michael pw

michael pw

    GMC Member

  • GMC Member
  • 1488 posts
  • Version:GM8.1

Posted 19 October 2009 - 09:44 PM

this looks pretty cool, i don't really know loads about the http protocol but can this do text file uploads?
  • 0

Known as MishMash on the internet, If only my username could be changed :D?

Posted Image

Working on Sharp Edge, a 3D Level designer which exports to GMMOD and textures, with a vast toolset, and fancy GUI. ( So far, software is only going to be distributed with my game, in the future, it will be up for public use and with the ability to customise the software using the Plugin System to suite your games needs.)
Also working on 3D Multiplayer FPS Global Anarchy Denied Operations.


#16 Maarten Baert

Maarten Baert

    GMC Member

  • GMC Member
  • 750 posts
  • Version:GM8.1

Posted 20 October 2009 - 06:48 PM

this looks pretty cool, i don't really know loads about the http protocol but can this do text file uploads?

You can't directly upload files, but you can post data to a PHP script and save the data in a text file:
<?php
if($_POST['validate']==md5($_POST['file']."SECRET-CHARACTERS-1".$_POST['data']."SECRET-CHARACTERS-2")) { // validation
file_put_contents(basename($_POST['file']),$_POST['data']);
}
?>
I wouldn't recommend it because it's a huge security leak if someone discovers the secret characters (by decompiling the GMK), but it's possible.
  • 0
Posted Image

#17 michael pw

michael pw

    GMC Member

  • GMC Member
  • 1488 posts
  • Version:GM8.1

Posted 20 October 2009 - 07:02 PM

cool thanks!
how would i run this in gm?

I wouldn't recommend it because it's a huge security leak if someone discovers the secret characters (by decompiling the GMK), but it's possible.

can it be discovered with a cheat engine? if it can't then its good enough, decompiling is illegal anyway so there commiting a crime...

Thanks for your help!!
  • 0

Known as MishMash on the internet, If only my username could be changed :D?

Posted Image

Working on Sharp Edge, a 3D Level designer which exports to GMMOD and textures, with a vast toolset, and fancy GUI. ( So far, software is only going to be distributed with my game, in the future, it will be up for public use and with the ability to customise the software using the Plugin System to suite your games needs.)
Also working on 3D Multiplayer FPS Global Anarchy Denied Operations.


#18 Maarten Baert

Maarten Baert

    GMC Member

  • GMC Member
  • 750 posts
  • Version:GM8.1

Posted 20 October 2009 - 08:05 PM

cool thanks!
how would i run this in gm?

I wouldn't recommend it because it's a huge security leak if someone discovers the secret characters (by decompiling the GMK), but it's possible.

can it be discovered with a cheat engine? if it can't then its good enough, decompiling is illegal anyway so there commiting a crime...

Thanks for your help!!


Something being illegal doesn't stop some (most?) people from doing it if nobody can find out ... But if you store the uploaded files in a separate folder and make sure all files are saved as .txt (not .php or any other extension) and check if the files are not too large, they can't do any damage I think.

Edited by Maarten Baert, 20 October 2009 - 08:05 PM.

  • 0
Posted Image

#19 michael pw

michael pw

    GMC Member

  • GMC Member
  • 1488 posts
  • Version:GM8.1

Posted 20 October 2009 - 08:07 PM

kk thanks, but how do i run it? thanks!
  • 0

Known as MishMash on the internet, If only my username could be changed :D?

Posted Image

Working on Sharp Edge, a 3D Level designer which exports to GMMOD and textures, with a vast toolset, and fancy GUI. ( So far, software is only going to be distributed with my game, in the future, it will be up for public use and with the ability to customise the software using the Plugin System to suite your games needs.)
Also working on 3D Multiplayer FPS Global Anarchy Denied Operations.


#20 Maarten Baert

Maarten Baert

    GMC Member

  • GMC Member
  • 750 posts
  • Version:GM8.1

Posted 21 October 2009 - 01:36 PM

Just upload the php script to the server, then download it with the dll. The example shows how you can post data to a php script.
  • 0
Posted Image

#21 FmMan3

FmMan3

    GMC Member

  • GMC Member
  • 189 posts
  • Version:GM:Studio

Posted 23 November 2009 - 05:21 AM

Not to be a pain, but I've spent a while trying to figure it out, I've managed to get it working with your example, but starting from scratch I can't seem to save a .ini from my site into a directory.
All I want to do is retrieve an ini file from my website and download it into a directory, I've got it working with the example, but how to do it alone, I'm stumped.

Some help will be appreciated, I've read, and re-read the help file to no avail. :|

I must just be really tired and will probably get it after some rest, but still, help would be great.

Thanks in advance.

P.s. I've worked out that in the example without the switch statement it fails to return any result when getting the message body, however I know of no way to get around that whole switch function... is it mandatory that I have that message asking whether I want GET or POST? because I don't wish to have that message pop up at all.

Edited by FmMan3, 23 November 2009 - 06:26 AM.

  • 0
Signatures are nothing but a fad.

#22 Maarten Baert

Maarten Baert

    GMC Member

  • GMC Member
  • 750 posts
  • Version:GM8.1

Posted 23 November 2009 - 12:33 PM

There are two scripts in the example (netread and download) that show how to read and download files. Did you use these? If you did, you have probably missed this part:
/*

Put this in the game start event:

httpdll_init();
if http_initerror() {
show_message('Initializing HTTP dll failed!');
game_end();
exit;
}
if !http_startthread() {
show_message('Failed to start socket thread!');
game_end();
exit;
}

*/
And don't forget to stop the thread in the game end event ;).
  • 0
Posted Image

#23 FmMan3

FmMan3

    GMC Member

  • GMC Member
  • 189 posts
  • Version:GM:Studio

Posted 23 November 2009 - 02:43 PM

There are two scripts in the example (netread and download) that show how to read and download files. Did you use these? If you did, you have probably missed this part:

/*

Put this in the game start event:

httpdll_init();
if http_initerror() {
show_message('Initializing HTTP dll failed!');
game_end();
exit;
}
if !http_startthread() {
show_message('Failed to start socket thread!');
game_end();
exit;
}

*/
And don't forget to stop the thread in the game end event ;).

Thank you for the reply, after going through the scripts several times I managed to get it running fine, and now that you made more sense to that download script I understand fully :D
Sorry, I had extreme lack of sleep last night, and spending the time on GM using new DLL's half asleep probably wasn't the best idea :P

Thanks a ton :)

And I love the DLL, it's just what I was looking for!
  • 0
Signatures are nothing but a fad.

#24 jwheeler

jwheeler

    GMC Member

  • New Member
  • 250 posts

Posted 29 December 2009 - 01:48 AM

I see everyone is using it to download files, but can it be used to make online matches/games, is it easier than 39.dll, and is it quicker?
  • 0

#25 Maarten Baert

Maarten Baert

    GMC Member

  • GMC Member
  • 750 posts
  • Version:GM8.1

Posted 29 December 2009 - 02:37 PM

I see everyone is using it to download files, but can it be used to make online matches/games, is it easier than 39.dll, and is it quicker?

Quicker: I don't think there is any difference.
Easier: If you are using a webserver it's definitely easier to use this. But if you want to create your own 'real' server you should use 39dll.
  • 0
Posted Image

#26 Poddington

Poddington

    Lucky To Reach 30

  • GMC Member
  • 267 posts

Posted 04 March 2010 - 12:41 PM

You can use this to create a fake real time server where up to the millisecond interaction between players isn't important and can parse info through the webserver for tracking, monitoring and filtering.
  • 0

#27 petenka

petenka

    The Chosen One

  • New Member
  • 911 posts

Posted 04 March 2010 - 04:35 PM

You can use this to create a fake real time server where up to the millisecond interaction between players isn't important and can parse info through the webserver for tracking, monitoring and filtering.

Especially turn based games. Using a webserver for those is much cheaper and works reliably.
  • 0
My Stuff:
Attack of the Jelly - A game about (oh, the horror) strawberry jelly!
Math Based Platformer Engine - The best physics for a platformer, ever.
Realtime Dynamic Fog - For realistic environmental effects.
Windy Snow - The best snow in all of gmc.
My Hate List:
Kubanen, Alex4Red, johnjoe

#28 tomster1996

tomster1996

    GMC Member

  • New Member
  • 312 posts

Posted 06 March 2010 - 08:43 AM

I might use this in my next game. I neaded a way to read from files on the web, and this looks perfect. I'll try it out later.
  • 0

#29 icuurd12b42

icuurd12b42

    Self Formed Sentient

  • GMC Elder
  • 18181 posts
  • Version:GM:Studio

Posted 06 March 2010 - 10:05 AM

interesting, I thinking of possibilities...

Would you implement tags and xml data right in the dll?
  • 0

gmcbanner.pnggmcbanner_tools.png

ICU Live Tutoring Through Slack or Skype | My Tools Page follow.png

I FRANTICALLY MADE MY 18000 POST TOPIC BEFORE MIKE ANNOUNCED A DELAY...
Now I'm squirming not to hit that reply button


#30 Maarten Baert

Maarten Baert

    GMC Member

  • GMC Member
  • 750 posts
  • Version:GM8.1

Posted 06 March 2010 - 01:18 PM

I'm too busy with ExtremePhysics right now. If you want you can add it yourself, here's the source code:
http://gm.maartenbae..._dll_source.zip
  • 0
Posted Image

#31 icuurd12b42

icuurd12b42

    Self Formed Sentient

  • GMC Elder
  • 18181 posts
  • Version:GM:Studio

Posted 07 March 2010 - 05:45 AM

I'm too busy with ExtremePhysics right now. If you want you can add it yourself, here's the source code:
http://gm.maartenbae..._dll_source.zip


Thanks, I have a project in mind... If I ever get arround to it, sooo busy, I will.
  • 0

gmcbanner.pnggmcbanner_tools.png

ICU Live Tutoring Through Slack or Skype | My Tools Page follow.png

I FRANTICALLY MADE MY 18000 POST TOPIC BEFORE MIKE ANNOUNCED A DELAY...
Now I'm squirming not to hit that reply button


#32 Poddington

Poddington

    Lucky To Reach 30

  • GMC Member
  • 267 posts

Posted 12 March 2010 - 06:20 AM

A question about the structure. When you initially start httpdll_init() it creates global variables. If i move room and then come back, the values in the globals double. I assume it's adding a second structure on top but i'm unable to work out the effects of this. While testing a time out script i moved between two rooms about 10 ten times, the globals increased each time. Connection and parsing web data did seem unaffected, but i'm curious on long term effects and how to stop it doing this. Seems redundant for it to do this and i want to know how to stop.

I have httpdll() in the create event of the log in object in my room, is there a better alternative? I've also tried running ! and not checks on it, but so far they haven't worked.
  • 0

#33 icuurd12b42

icuurd12b42

    Self Formed Sentient

  • GMC Elder
  • 18181 posts
  • Version:GM:Studio

Posted 12 March 2010 - 06:54 AM

A question about the structure. When you initially start httpdll_init() it creates global variables. If i move room and then come back, the values in the globals double. I assume it's adding a second structure on top but i'm unable to work out the effects of this. While testing a time out script i moved between two rooms about 10 ten times, the globals increased each time. Connection and parsing web data did seem unaffected, but i'm curious on long term effects and how to stop it doing this. Seems redundant for it to do this and i want to know how to stop.

I have httpdll() in the create event of the log in object in my room, is there a better alternative? I've also tried running ! and not checks on it, but so far they haven't worked.


singleton objects/instance should be created only once...

what I do is I have a boot room that has an global controller (or I use the room code) where I initialise the singletons and all my global vars, then I perform a room_goto_next(). That first room is never run again... is also prevent other object trying to access the singleton before it is initialised, like if you have the code in the create of object0 to use the global var created in the create event of object1, boom...

My GlobalController usually initialises (and does the room_goto_next()) on Game Start event, and frees on Game End event, it's persistent so it stays present in the entire game, and in all the rooms so when the game ends, it frees stuff.

If you use such scheme, consider also moving it with the view, center in the view, invisible so unnoticed... that way if you decide to disable things outside the view, it won be affected.

Edited by icuurd12b42, 12 March 2010 - 06:56 AM.

  • 0

gmcbanner.pnggmcbanner_tools.png

ICU Live Tutoring Through Slack or Skype | My Tools Page follow.png

I FRANTICALLY MADE MY 18000 POST TOPIC BEFORE MIKE ANNOUNCED A DELAY...
Now I'm squirming not to hit that reply button


#34 Poddington

Poddington

    Lucky To Reach 30

  • GMC Member
  • 267 posts

Posted 12 March 2010 - 08:44 AM

Thanks for the advice, since i'm re-re-re-coding the network and databases (version 3) it wont be a problem implementing this.
  • 0

#35 Angelo

Angelo

    GMC Member

  • New Member
  • 168 posts

Posted 28 April 2010 - 09:44 PM

Would it be possible to integrate Facebook API calls into games with this dll?
  • 0

#36 powergannon123

powergannon123

    GMC Member

  • GMC Member
  • 342 posts

Posted 08 May 2010 - 09:07 PM

This DLL enables you to use the HTTP 1.0 protocol in your games. You can set the method, filename, headers and message body. The DLL uses a thread to take care of the downloading, so you can do whatever you want in your game while the download is running. The DLL supports up to 16 HTTP connections at the same time.

So what's so good about this? The same can be done with 39dll. True, but if you have ever tried this, you will notice it isn't that easy. GM's string functions are very limited (and slow), so it will be very hard to read headers, for example. Furthermore, as this DLL uses a thread to handle the socket connections, the downloads will run a lot faster as the thread can check them a lot faster than the game can. The DLL supports the entire HTTP/1.0 protocol (for receiving, for sending you can of course use HTTP/1.1 if the server supports it). The DLL should work with all types of servers. This DLL is like a combination of 39dll, Download Manager, Netread Dll and HTTP request dll.

You can:
- download multiple files at once (like Download Manager)
- read downloaded files directly (like Netread Dll)
- send HTTP requests (like HTTP request dll)
- ...
And all this can be done at the same time.

Download: HTTP Dll - ZIP (58.4kb)

Contains scripts, extension, an example (gmk) and a help file.


This looks perfect. I would really like to use this but it is very confusing to me. It would be nice to have step by step instructions on how to set up the connection.
  • 0

#37 zlo

zlo

    GMC Member

  • New Member
  • 1 posts

Posted 25 May 2010 - 02:59 PM

not working with fraps :lol:

Error defining an external function.

Edited by zlo, 25 May 2010 - 03:06 PM.

  • 0

#38 Glen

Glen

    GMC Member

  • GMC Member
  • 841 posts
  • Version:GM:Studio

Posted 28 May 2010 - 02:02 AM

Can I use php files with this? I have a php file hosted on my website. I want to be able to access it.
  • 0
Avic Pro (Work in Progress):
Portable media manager. Just pop in your usb drive and use Avic Pro to organize and present all of your media content in categories. On top of that, it makes handling portable games, software, and other utilities a breeze. It allows you to launch just about any of your media content quickly and efficiently from your system tray. No more long paths to finding content.
Savage Defence| Text FX | Ragdoll Axe Engine | Professionalism | Online Games | Game Progression | 3D Game Development | Online Anti-Hack Strategies

#39 Maarten Baert

Maarten Baert

    GMC Member

  • GMC Member
  • 750 posts
  • Version:GM8.1

Posted 28 May 2010 - 02:19 PM

Can I use php files with this? I have a php file hosted on my website. I want to be able to access it.

Yes. But you won't see the actual PHP code, just the output of the script. Assuming your host supports PHP of course.
  • 0
Posted Image

#40 Glen

Glen

    GMC Member

  • GMC Member
  • 841 posts
  • Version:GM:Studio

Posted 28 May 2010 - 10:59 PM

Can I use php files with this? I have a php file hosted on my website. I want to be able to access it.

Yes. But you won't see the actual PHP code, just the output of the script. Assuming your host supports PHP of course.

I have an email php script hosted on a server that supports php. I used to use the execute shell function to send an email. I'm looking to make the command without having to execute_shell (which opens a window on the internet browser when calling for the php script on my site). Just wondering if this dll will let me use the php page without opening it up on the screen.
  • 0
Avic Pro (Work in Progress):
Portable media manager. Just pop in your usb drive and use Avic Pro to organize and present all of your media content in categories. On top of that, it makes handling portable games, software, and other utilities a breeze. It allows you to launch just about any of your media content quickly and efficiently from your system tray. No more long paths to finding content.
Savage Defence| Text FX | Ragdoll Axe Engine | Professionalism | Online Games | Game Progression | 3D Game Development | Online Anti-Hack Strategies

#41 Maarten Baert

Maarten Baert

    GMC Member

  • GMC Member
  • 750 posts
  • Version:GM8.1

Posted 29 May 2010 - 04:26 PM

I have an email php script hosted on a server that supports php. I used to use the execute shell function to send an email. I'm looking to make the command without having to execute_shell (which opens a window on the internet browser when calling for the php script on my site). Just wondering if this dll will let me use the php page without opening it up on the screen.

Yes.
  • 0
Posted Image

#42 LoopStan

LoopStan

    North-See Developer

  • GMC Member
  • 1398 posts

Posted 18 September 2010 - 12:25 AM

Never mind, i got it working!

Edited by LoopStan, 18 September 2010 - 08:59 PM.

  • 0

Posted Image


#43 SmoTh

SmoTh

    GMC Member

  • GMC Member
  • 74 posts
  • Version:GM:Studio

Posted 01 November 2010 - 06:28 PM

When I use the POST method to login to a site I just get a "object move to account.aspx" If I then try to get the body of account.aspx I just get a "object moved to login.aspx"..

How can I submit a login form and stayed logged in so I can freely browse the files behind the login?

Edited by SmoTh, 01 November 2010 - 06:35 PM.

  • 0
This is a signature...

#44 Maarten Baert

Maarten Baert

    GMC Member

  • GMC Member
  • 750 posts
  • Version:GM8.1

Posted 04 November 2010 - 06:44 PM

That depends on how the website was designed. Some websites will redirect you a few times, you might have to follow the redirects to log in successfully (you can read the 'Location' header to get the new url).
  • 0
Posted Image

#45 SmoTh

SmoTh

    GMC Member

  • GMC Member
  • 74 posts
  • Version:GM:Studio

Posted 04 November 2010 - 07:56 PM

That depends on how the website was designed. Some websites will redirect you a few times, you might have to follow the redirects to log in successfully (you can read the 'Location' header to get the new url).



Thanks for the response. I'm redirected to account.aspx, I tried to get the html output from that page immediately after sending the login information but was just redirected back to login.asp. I assume that the website uses sessions as a mean to check if the user is logged in or not. Could it be because this session is not created or remembered that I keep getting redirected back to the login page? Or perhaps I'm not redirecting my program correct?

After sending the login information I use this code to read the next page..

url = http_urlencode("http://somewebsite.com/account.aspx",true);
hostname = http_url_get_hostname(url);
port = http_url_get_port(url);
filename = http_url_get_filename(url);
http_set_filename(http,filename);

edit: the returned statuscode is 302 if that's any help..

re-edit: I get a lot of header information when logging in before I try to redirect. Do I have to use this information when redirecting using http_set_headers_in? I've tried to send in the information I've gained from logging in but I just get the statuscode 411

re-re-edit: Okay I believe I know what the problem is. The login script requires cookies to be accepted. Can anyone please help me with this? There are several cookies with the header name Set-Cookie but if I try to get it I only get one of them.. further more I have no idea how I should send it back to the server.

Edited by SmoTh, 05 November 2010 - 01:15 PM.

  • 0
This is a signature...

#46 Maarten Baert

Maarten Baert

    GMC Member

  • GMC Member
  • 750 posts
  • Version:GM8.1

Posted 06 November 2010 - 01:54 PM

The server will probably send something like
Set-Cookie: COOKIENAME=COOKIEVALUE; Max-Age=3600
You have to reply with
Cookie: COOKIENAME=COOKIEVALUE

If there are multiple headers with the same name, http_get_header_value won't work. You will have to use http_get_headers instead and extract the values yourself.
  • 0
Posted Image

#47 Windsdrow

Windsdrow

    GMC Member

  • Validating
  • 303 posts

Posted 08 January 2011 - 08:02 PM

How to draw ( Download % ) progress bar?Thank YOU.

#48 poxbear

poxbear

    GMC Member

  • GMC Member
  • 35 posts

Posted 05 March 2011 - 12:27 PM

Hi,

This is is great dll, but i only need a small part of it.

Could someone please strip the source code of this down to just sending post data and get data for me.

Thanks,
PoxBear
  • 0

#49 Maarten Baert

Maarten Baert

    GMC Member

  • GMC Member
  • 750 posts
  • Version:GM8.1

Posted 05 March 2011 - 05:48 PM

Hi,

This is is great dll, but i only need a small part of it.

Could someone please strip the source code of this down to just sending post data and get data for me.

Thanks,
PoxBear

You would still need about 90% of the original code. The size of the DLL is not the same as the number of functions exported to GM :).
  • 0
Posted Image

#50 goresoft

goresoft

    GMC Member

  • GMC Member
  • 161 posts
  • Version:GM:Studio

Posted 17 March 2011 - 02:15 PM

hi Maarten Baert, good work with this dll.

I've a little problem with POST function...

My objective is to send informations to a php page in witch i wrote this:


<?

$name1=$_POST["name"];

$namevalue=$POST["value"] ;

echo $name1.$namevalue;

?>


i've used your main example using as url this: http/goresoft.altervista.org/prova.php

POST as function, name as "myname" value="1"

when i open the php page in my web browser a blank page is returned.

Where is the error?

i expected a page with that values!

Edited by goresoft, 17 March 2011 - 02:16 PM.

  • 0

Portfolio :  ASTRO n. z. o. (HTML5)--||||--Fly Chris Fly!!(Android)--|||--ICY BERG (Windows) 

Facebook page : Blue Vessel Games 
 
Twitter : @bluevesselgames