Search code examples
phpjavascriptdatabasesurvey

javascript: store data in a file or db without php?


i have to build an webapp, a simple survey with 5 answers, and i want to store the users choices (so to give the results) but i'm not allowed to use mysql or php... is it possible to use just jquery/javascript?


Solution

  • When you say "store the answers", in what way? You want to store them for retrieval later by a third party? If so, you need some type of external storage, whether it is self-hosted database (mysql) with a server-side interface to store it (php), or a third-party solution that does the same thing for you.

    Javascript itself is client-side. This means that, in the absence of supporting technologies, javascript is like Las Vegas: what happens on the client computer stays on the client computer. You can use javascript to store data locally via element storage or cookies, but in order to retrieve this data later, you'll have to use some other technology.