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

  • Home
  • SEARCH
  • 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 221107
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T19:00:08+00:00 2026-05-11T19:00:08+00:00

The Situation I have a very compressed time schedule to write a simple (basically

  • 0

The Situation

I have a very compressed time schedule to write a simple (basically write-only web app). The app is to be a mostly jQuery-driven question tree. The questions and tree will probably need to change both before and after the site launches.

The answers will get emailed… I probably don’t even need to store them, but I’m going to just in case.

This needs to be slapped up on a shared host in very short order.

My proposed strategy

The Question Tree Itself

Implement the question-tree and validation mostly in jQuery and HTML. Keep the question-answer state stored as a javascript object with “Question text” : “Question answer” as the format for each question.

The form validation would be jQuery based only, no server side validation of individual fields other than (as mentioned later) making sure only valid JSON is inserted.

Identifying a User

Handle session state with PHP, use the PHP session ID as the unique key for each user.

As each question is answered, make a simple AJAX call to a very simple PHP script that accepts the PHP session ID, and the JSON repreentation of the object. (The reason for sending it each time is so if the user quits answering questions, at least we get SOME data.)

Storage

Storage is handled in a (php embedded) SQLite DB like this:

CREATE TABLE q_and_a_storage (
  php_session_id text primary key,
  json_storage text
);

Server Side

The PHP AJAX receive script is very dumb. It simply checks the DB to see if the session id exists, and then INSERT’s or UPDATES’s as appropriate. It also makes sure that the response is valid JSON before inserting.

I just want to know if this is incredibly foolhardy or if it is reasonable. Is there some big security hole I’m not thinking of?

Things people are going to want to know:

  • I’m estimating under a million fillers of the form in this iteration
  • All we really need to do is make sure we send an initial email with the data but I’m storing it just in case
  • It’s VERY likely I’ll need to retune the question set, and have almost no way of knowing which questions should go and which should stay.
  • If I need later analysis of the data I can later send it to a CouchDB and run map/reduce queries on it, which is why this model is attractive to me.
  • It SEEMS like the javascript only form submission deters most spam, and the only payoff for attack is useless JSON stored in the DB.
  • Super quick development time and flexibility of the question set are the really important factors here.
  • 1 1 Answer
  • 1 View
  • 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-11T19:00:08+00:00Added an answer on May 11, 2026 at 7:00 pm

    Very thorough explanation, thanks. So the one weak spot I see here (if it matters) is that anybody who can evince or guess the session id can “retroactively change” the JSON that represents the answers — I know you say that JSON is “useless”, but, if that’s the case, then why are you storing it in the first place?-) Maybe I’m being overly paranoid about the php session id’s security (if it’s essentially secure, then my objection crumbles), but if there’s any value to a potential spammer in performing such retroactive changes, then I’d add a validation level (based on securely encrypted cookies under my own control…).

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

Sidebar

Ask A Question

Stats

  • Questions 165k
  • Answers 165k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer Categories extend the original class, but they don't subclass it,… May 12, 2026 at 12:54 pm
  • Editorial Team
    Editorial Team added an answer Haven't tested this, but it's something like: RewriteRule \.php$ -… May 12, 2026 at 12:54 pm
  • Editorial Team
    Editorial Team added an answer "0:0:0:0:0:0:0:1" is the IPv6 loopback address as defined in RFC… May 12, 2026 at 12:54 pm

Related Questions

How do I improve the performance of the following situation? I have an application
I'm slowly learning SQL and how to use form builder 6. The situation is
I have a very common situation. I have a file, and I need to
I need to store user entered changes to a particular table, but not show

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

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.