Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

store user input without mysql or php

I have a simple html application which displays words on a click of a next button. It fetches the words from a javascript object literal file. I want to mark some of the words as easy and some as difficult. How do I save this data from browser without using a mysql database? can I edit the javascript object file directly from bowser?


2 Answers

If you want to take user input and store it permanently on your site, you'll have to employ some sort of server-side scripting. This doesn't have to be PHP, but it's probably the simplest way to do it. You can't use client-side javascript to write to a remote file directly.

like image 120
Jeff Avatar answered Feb 18 '26 11:02

Jeff


If I understand correctly, you have JS object/array with words, you're modifying it and want to store it modified version permanently.

If so, then you can use "HTML5" localStorage.

This storage is per-browser. If you want to have single version shared between many users/browsers, then you will need some server-side support.

like image 35
Kornel Avatar answered Feb 18 '26 11:02

Kornel



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!