Skip to main content
gamedev.net
🔒 Locked

php in network programs

Started by Jabus10 Apr 8, 2006 at 1:54 PM 1 replies 1k views
Original Post
Jabus10
Jabus10
I have wanted to make a basic high score program so that users can send their scores in and you can then view the highesst scores online but i don't want to pay for server lesing or server location. Is it possible to make a php script on a site that you could then post the information about the score and then the php script checks a database and then sends a message that tells the game if it is in the top ten? If it is possible are there any tutorials on using the Post command in winsock. I greatly appreciate any help.
Kylotan
Kylotan
To use the PHP page, you will need hosting of some sort. Maybe there is free hosting somewhere. I expect the chance of having to pay for it will go up if you require a database, too.

As for posting results using Winsock, it's a little complex. You are probably better off starting with a GET request - open a connection to the relevant host and port 80, issue a line like "GET /highscore.php?score=12345 HTTP/1.0", followed by 2 blank lines, and then just read the response until it's completed.

You may prefer to use a library like CURL, however. I think that makes life a fair bit easier if this is your first bit of network programming.
hplus0603
hplus0603
The Forum FAQ talks about how to host applications.

The HTTP-GET library is a simple and lightweight way to read URLs (although libCURL is significantly more capable).
enum Bool { True, False, FileNotFound };

Topic Locked

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

Sign in to reply to this topic.