Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
  1. #1
    Regular Coder
    Join Date
    Dec 2006
    Posts
    417
    Thanks
    168
    Thanked 1 Time in 1 Post

    Is there a secure JS AJAX method?

    Thinking of creating a text based RPG game for fun.

    Thinking of using JQUERY/PHP/mySQL

    I will either use XML or JSON to send data to the server using AJAX requests.

    Unfortunately, using Firebug, a player can easily find out the variables I am using to store player data (experience points, combat, levels, etc).

    Therefore, it would be fairly easy for a player to hack their account's variables and potentially "cheat"

    Is there a fairly secure Javascript way to send data to the server via AJAX?

    Thanks

  • #2
    Master Coder felgall's Avatar
    Join Date
    Sep 2005
    Location
    Sydney, Australia
    Posts
    6,633
    Thanks
    0
    Thanked 649 Times in 639 Posts
    If the site has a security certificate and the page is served using HTTPS then the information passed between the client and the server will be encrypted.

    Everything in JavaScript is able to be modified by the browser owner - they can attach their own scripts to your page that completely overwrite yours - this applies to all JavaScript code.
    Stephen
    Learn Modern JavaScript - http://javascriptexample.net/
    Helping others to solve their computer problem at http://www.felgall.com/

    Don't forget to start your JavaScript code with "use strict"; which makes it easier to find errors in your code.

  • #3
    Senior Coder rnd me's Avatar
    Join Date
    Jun 2007
    Location
    Urbana
    Posts
    4,301
    Thanks
    10
    Thanked 586 Times in 567 Posts
    Quote Originally Posted by Bobafart View Post
    Unfortunately, using Firebug, a player can easily find out the variables I am using to store player data (experience points, combat, levels, etc).

    Therefore, it would be fairly easy for a player to hack their account's variables and potentially "cheat"
    the games rules must be enforced by the server if you have several people playing the same game on different machines.

    client-side js alone can only do single player games.
    my site (updated 13/9/26)
    BROWSER STATS [% share] (2014/5/28) IE7:0.1, IE8:5.3, IE11:8.4, IE9:3.2, IE10:3.2, FF:18.2, CH:46, SF:7.9, NON-MOUSE:32%


  •  

    Tags for this Thread

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •