Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7999163
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T15:25:24+00:00 2026-06-04T15:25:24+00:00

OK, I am creating a game using JavaScript and HTML5. The variables such as

  • 0

OK, I am creating a game using JavaScript and HTML5. The variables such as map, x, y, level, exp, etc are stored in JavaScript to keep track. On my client page, the JavaScript variables are stored to play along with the game. Every 5 seconds, the client page sends a POST AJAX call to the MySQL database and it successfully updates it.

However a user can easily modify the JavaScript variables and cheat their way in the game. Then once they edit the JavaScript variables, the POST grabs that and updates it even though they edited it unethically.

So, how do I prevent this from happening?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-04T15:25:26+00:00Added an answer on June 4, 2026 at 3:25 pm

    Unfortunately, there is no way to prevent client-side code from being manipulated by a malevolent party. However, in many cases, there are certain behaviors that could potentially signal possible abuse.

    For instance, if the maximum amount of hit points I can regain via a healing potion is 100 points, and a user suddenly increases by 1000, then you know there was abuse. Your strategy should involve putting checks in your code as validation to ensure that the data returned to your application makes sense.

    This concept is a lot like what a business application developer might do to make sure that data entered in a web form is validated. If there are certain values that are illegal or that shouldn’t be submitted, the server responds with an error message and instructions on what fields need to be filled out.

    In your case, it may still be possible for someone to “game the system” at levels below certain thresholds. Start small, and as you analyze the data, you’ll find more areas where you can implement this type of validation of your data.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

i'm looking at creating a web game using html5 canvas and javascript. i was
I'm starting my hand at creating a multi-player game using HTML 5 / Javascript.
I'm creating a game for the iPad using Phonegap, which means I'm using JavaScript/
I am creating a platform game in JavaScript using canvas which is entirely tile-based.
I am creating a game with an ascii-like map using Java2D on Linux (like
Possible Duplicate: XNA Mouse Movement Basically, I am creating a game using XNA, and
I'm creating a graphical roguelike game using Java. In the game, I'm painting a
Creating a simple RPG game, first time using XNA. Trying to get my character
I'm creating an Android application (a game, to be more precise) and using AndEngine
I'm creating a building game in JavaScript and PHP that involves a grid. Each

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.