How to save game information PHP/HTML/CSS/JS [closed]


Tags: javascript,php,html,css,ajax

Problem :

I am building a web browser text base RPG game with PHP/Javascript/HTML and CSS.

Each user has some information like his Name, Level, Experience, Gold and more. All the data is saved in the database.

When moving from pages in the game what will be the right method to store the data to be use in all the pages?

I thought about the following options:

  1. PHP SESSION
  2. Cookie
  3. Using GET with the info in the link.

What do you think is the right way to do it? In aspect of data security, hacking, easy etc.

Currently I am thinking about using PHP SESSION.



Solution :

Assuming that most of your game logic is executed on the server side, keep the game state in the PHP session. Other than cookies and GET parameters, the session information is stored on server side and for this reason out of reach for manipulations by the user.

In addition to that, save consistent states to the database often to make the game information persistent.


    CSS Howto..

    How do I add a shadow to an entire table using just CSS?

    How to stick a div when scrolled past 50% of the item?

    How to run CSS text animation in a sequence. (one line of text after another)

    In CSS how to achieve, two cells with auto width in fixed width parent, with priority to see content in second cell and with ellipsis at first cell?

    CSS - How to make a div as wide as a containing child img

    Navigation Menu That Shows/Hides On Rollover and Click

    How can I size these spans so that the pictures don't extend past them?

    CSS exit box how to? [closed]

    make a div fold out to show content

    How to get just the responsive grid from Bootstrap 3?

    How to make a slider with divs and variable width?

    How to change menu icon when scrolling to specific sections of the website?

    How to make a HTML element fill a dynamically sized container using CSS

    How to design multiple time clock wise rotation of a image in css

    how to make a drop down menu fixed from the top with css?

    how to change css after some seconds continously?

    How to call CSS from JavaScript

    How can I make it so the first element in a DIV has a different CSS to others?

    Polymer 1.x: How to imperatively (using JS) obtain the value of a custom CSS property?

    How to make my twitter bootstrap overlap all other elements?

    GWT - How to create a drop down menu

    How to center text in my div

    jQuery how to add another css in code?

    How (and why) to use display: table-cell (CSS)

    How to add/remove class to parent div according to input radio selection using jQuery?

    Show a box on top of an image in an HTML page

    How to show/hide delete button with CSS?

    how to position an element right below an “absolute” div?

    How to create three columns in css

    How to select all a pseudo-classes in CSS?