Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

185
Vistas
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 Respuestas
Responde la pregunta

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 Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda