I’m creating a page for myself that could be accessed without internet connection (local storage only).
I want that page to somehow store data (that I put in the website) on my computer.
I’ve heard there are ways to edit .txt files with a help of php? Also maybe Chrome could somehow save that info easier?
Appreciate any help
EDIT: I want a fast and easy access to a website via Chrome only, so I prefer not to be using XAMPP or any other software.
The easiest way would be to use HTML5’s localStorage (no server-side languages needed), but it won’t be easy to get that data outside of your page (I understood you’ll be using that offline page which has stored data).
It’s as simple as:
window.localStorage.setItem('myItem', 'Hello World');
And then to get it, you’d just do:
Array approach works as well (
Here is a simple example from above: http://jsfiddle.net/h6nz1Lq6/
Notice how the text remains even after you remove the setter line and rerun the script (or just go to this link: http://jsfiddle.net/h6nz1Lq6/1/
The downside of this approach is that the data can easily be cleared by accident (by clearing browser/website data, but again this is similar to accidental deleting of a file, so nothing to be afraid of if you know what you’re doing) and that it doesn’t work across browsers (each browser stores its own localStorage).
If you still decide to use a server-side language, there are millions of tutorials about them. For a beginner, it would probably be the easiest to use a simple PHP script to write a file, but that would require using a server on your machine.