I am trying to create a game leaderboard website which will contain people's highscores from different games.
I have 3 tables users
, games
and gamedata
.
The columns are as follows.
users
: id | namegames
: id | title | owner_idgamedata
: user_id | game_id | highscore
I have a Javascript api which third party game developers use to create a submit score
button in their game.
When they send me data I receive them using $_POST
and query it in my game_data
table using " Insert into game_data(user_id, gameid, highscore) values('$_session['user_id']', '$gameid', '$score')"
Now as you know anyone can send me fake data of $gameid
and $score
.
Since I have no control over those two datas on my server how is it possible to ensure the security of sent data from third party sites?