The Unity and PHP code that is presented illustrates a simple, unsecured web-based leaderboard. To prevent players from hacking into the board with false scores, we should encode some form of secret game code (or key) into the communications. Only update requests that include the correct code will actually cause a change to the database.
Note: The example here is an illustration using the MD5 hashing algorithm. For protecting a personal game, this is fine, but it's quite old and would not be suitable for sensitive or valuable data, such as financial or personal details. Some links to articles on more secure approaches can be found at the end of this topic.
The Unity code will combine the secret key (in this example, the harrypotter string) with something related to the communication – for example, the same MySQL/PHP leaderboard may have different database records for different games that are identified with a game...