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 4091906
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T19:25:30+00:00 2026-05-20T19:25:30+00:00

While developing a Facebook game, I’m realizing that I can’t yet think of a

  • 0

While developing a Facebook game, I’m realizing that I can’t yet think of a secure way to change user data (like, for example, player health), which I want to do via AJAX calls. If I call a script such as change_user_health.php with the parameters {userid : 12345, newhealth : 25}, how can I call it in such a way as to prevent users from peeking at the script and calling that script themselves to, say, give themselves full health at all times?

I was originally thinking of passing a hash (perhaps a salted MD5 encryption of a certain value), but this hash would be visible within the JavaScript that calls the AJAX script file. What can I do to call an AJAX PHP script without the user seeing how the MD5 hash is salted and composed? I want the hash to include the health value (25 in the above example) in its composition, so that the user can’t just pop in a different value (like 100) with the same hash.

  • 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-05-20T19:25:31+00:00Added an answer on May 20, 2026 at 7:25 pm

    The solution: Make everything server-side.

    Say, player get’s hit. Instead of doing a request to send set the players HP ( setPlayerHP( current_hp – damage ))

    send a request to inform the server that the player has been hit, and let the server handle that and send the remaining hp in the response. ( playerHit() )

    The server should then figure out what hit him, and what armor he is wearing. You can’t trust javascript at all… If for example you sent the monster id along with the request, or the armor id, then the player could easily forge that.

    What you are into sounds like an interesting programming experience 🙂 Lag makes things a lot funnier, too.

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

Sidebar

Related Questions

While developing my app I have come to realize that the majority of my
While developing a C++ application, I had to use a third-party library which produced
While developing products, we often need to create proprietary tools to test some of
While developing a new query at work I wrote it and profiled it in
After working for a while developing games, I've been exposed to both variable frame
I've encountered an interesting problem while developing for our legacy XWindows application. For reasons
I've been experiencing very inconsistent results while developing an iPhone app and trying to
I am new to UserControls, and while developing my own control I found a
My team is moving from Visual SourceSafe to Subversion soon, while developing/supporting a legacy
I've been developing Web applications for a while now and have dipped my toe

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.