Hey Moto,
Ok, here's what you need to understand. When someone is playing your game, their web browser will not maintain a permanent connection to your server. Instead, every time they click on a link they will make a brief connection, send and receive some information, and then close the connection.
This creates a problem because to maintain a history for each player (ie, to know what they previously did in the game), you will need to be able to identify the user each and every time they connect.
To solve the problem, you do this:
* You ask the user to login, ie, they enter an email address and a password and then hit a submit button to send the info to your server.
* PHP then reads the email and password and validates it against some kind of database.
* If their login is correct, you create some kind of unique ID in PHP - this could be a random sequence of numbers or characters or both, and then you write this uniqueID to a cookie in their browser.
* From then on, every time the user clicks on a link you can read your cookie, which is sent automatically by the browser to the server with each request. Then you know who they are, so you can make your game react accordingly.
If you need an actual code sample of how to do this you can email me via nycran at yahoo dot com
Cheers.