Skip to main content
GameDev.net gamedev.net
🔒 Locked

libcurl programming

Started by DrEvil Nov 1, 2004 at 2:03 PM 2 replies 450+ views
Original Post
DrEvil
DrEvil
Hey all, I don't know alot about http programming, so I have a couple questions. First off here is what I want to do. I have a client/server game. I want to let the server send a small amount of information about itself to a web site using php so that the site can add the server information to the websites database. It appears like I may be able to do this using libcurl, but I'm not sure how to structure the php or the request. Perhaps something like http://www.website.com/test.php?servername=testserver&ip=xxx.xxx.xxx.xxx So that the information such as server name , current players, ip, all that can be added to the websites database, basically like a master server list. In addition I want the clients to be able to request this information from the web server, probably through a php request however you do that. It appears that libcurl will be able to do these things, but I'm unsure how to structure the actual http request. Anyone have any insight on this? Thanks in advance.
Muhammad Haggag
Muhammad Haggag
I'd use a form-post for adding server information to the website database - curl has support for this (check the docs for form post).

For requesting data, I'd just use an HTTP GET request to retrieve a page like http://www.website.com/list.php using curl. list.php would generate Xml or something from the database. That way, the client will have the Xml or whatever you use, and can work with that.

Muhammad Haggag
Muhammad Haggag
Quote:
Original post by DrEvil
Anyone?

Why do I always have to reply to myself before getting any responses?

Well. Because you're special, of course [smile]

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.