The behavior is, when the player begins the game: I create a new row in DB (with ajax and php), and I insert in that new row information like, random number (unique) to identify that single game, information about the puzzle the player play (I will have lots of pictures puzzles).
When the customer finish the puzzle, I send to DB (ajax and jquery again) the time player use to finish the puzzle and the information about how many moves player use to finish the puzzle.
In a beautiful world without hackers that work perfect.
What I need in this question is some opinion about the best way to protect my code and the communication to the server in each game.
Note: I use post method for send the information to the server. first the information going to a different .php file, and that php file send the information to the database.
If you want see code, please tell me.
The best regards, JC