Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

180
Visualizações
How to prevent unauthorized saves to database?

I'm building a simple clicker game to be played online.

The game saves clicks to my database by executing an Ajax post call to a php script.

Now I'm trying to figure out how I could limit the post submits from my server only so people couldn't cheat by just sending their own scores straight to the database by posting.

I tried limiting posts to my server IP or localhost but that doesn't work as Ajax post uses the users own IP and not the servers IP to post. So I wasn't able to post even from my own server anymore after that.

I'm saving the clicks to localstorage which I know is another place where people could cheat.

What could I do to only allow the posts from my server?

about 4 years ago · Juan Pablo Isaza
1 Respostas
Responde à pergunta

0

One cheat-proof solution would be to make the server increment the clicks while user/player only send an info about an action - like in a multiplayer game.

You would need a web-socket connection to the server and treat each connection/socket as an individual player.

One easy solution would be to use Node.js backend + socket.io library.

about 4 years ago · Juan Pablo Isaza Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda