As you said, you will need a server, but you can have two types of design:
The server can only serve as a gateway between players for connecting to each other: its two use is, firstly, a list of running games, and secondly, a list of players IP addresses, so that each client will read IP addresses and connect to him. This will require less bandwidth and processing power for the web server and more for the client who will host the game. In this configuration, one of the clients will act as a server and will send data to others. If your game has only one of the players playing at a time, and not a lot of players, this is what you should use, since you are paying for the power of the server.
The server can also store all the states of the games: your game may require much more processing power and / or bandwidth.
In any case, most of the time you will need only one machine (which can change during the game, as in the first case) to perform processing, and the rest will receive only the calculated data.
To program a network game, you need knowledge of sockets (deep knowledge in the first case, because you have to deal with NAT problems, routers block the path between clients). The Beej Guide to Network Programming is the number one guide in this section, although it does not focus on games.
If the WWW server does not require too much processing, you can deal with it using server scripting languages ββsuch as PHP along with MySQL, but you will most likely use your own server programmed in C ++ (or C ) If you use C ++, you can use an existing library such as RakNet .
The client will obviously be programmed in Objective-C, as on the iPhone. I believe that there is a good network infrastructure that studies the number of online games, so you may not want to use a network library of external servers.
It may be too much for what you want to do, but you can also use the famous Torque Engine .
source share