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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T18:50:07+00:00 2026-06-08T18:50:07+00:00

I have a theoretical question about how to approach a current project. It is

  • 0

I have a theoretical question about how to approach a current project. It is a fairly simple matching quiz using JS + PHP. I am simply taking care of business logic on the server (answer checking, score updating) such as to roughly follow MVC conventions.

My current setup:

  • HTML + JS page to allow the user to drag and drop answers onto questions. On a successful drop, the question + answer combo is sent to the following:
  • A server-side PHP page to check the answer correctness based on an XML file. I return a few pieces of data in some XML client, such as true/false and number of attempts at a certain question. In addition, if the answer is correct, I increment a Session Variable on the server to keep track of the user’s score.

My question revolves around best practices for setting the above mentioned session variable for tracking the score. I understand that a more persistent setup is most likely preferable, in case of computer shut-off, accidental browser closing, etc…but strictly based on this setup –

  1. Is this a secure method for storing a score for a final insertion into the database?
  2. I eventually will have to pull the score down from the server at the end of the game (or even mid game, for that matter), as well. Should I create a simple ‘getter’ PHP page to pull the score down, and just access the session variable and send it to the client?
  3. Currently, the user actually has access to the php server-side page becuase it resides in the same folder as the actual quiz. This is moooost likely a no-no – but what is the common practice for hiding this server-only file from the user’s prying eyes (without having to use authentication)?
  • 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-08T18:50:09+00:00Added an answer on June 8, 2026 at 6:50 pm

    Is this a secure method for storing a score for a final insertion into the database?

    It is secure. But I don’t see a why you wouldn’t update the scores in the database as they are changed. This way it will be persistent.

    I eventually will have to pull the score down from the server at the end of the game (or even mid game, for that matter), as well. Should I create a simple ‘getter’ PHP page to pull the score down, and just access the session variable and send it to the client?

    Sounds like a plan.

    Currently, the user actually has access to the php server-side page becuase it resides in the same folder as the actual quiz. This is moooost likely a no-no – but what is the common practice for hiding this server-only file from the user’s prying eyes (without having to use authentication)?

    As long as the files are .php files and are parsed by the webserver the user can only do requests to the files and that’s it (if I understood the question correct that is).

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

Sidebar

Related Questions

I have a theoretical question about the .net framework. As I see it Microsoft
I'm flummoxed with (what I believe is) a seemingly-simple theoretical question about SAP BusinessObjects
I have theoretical question about OSGi memory management. Let’s say we have some OSGi
I have a sort of theoretical question about freeing a pointer. I think some
Theoretical question here: How do people feel about the restrictions that registration forms have
I have a theoretical question: 1) How pass a variable to the system of
I have a slightly theoretical question that I want to clear up before I
I have a very theoretical question: Is there a way to ban the use
I have a rather theoretical question. My company has a working standard (documented) that
I have a bit of a theoretical question, however it is a problem I

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.