Hi..

I want to make this frame on a website where there is a message. You have to be able to edit this message, and therefore it must be stored in some file, but how can i update it?

I don't want to use PHP or mySQL since the website is going to run localy only, and thats why its got to be storet in a file, or in a variable, if you can do that with Java or something...

I don't know..!

Please help me...

/Tobias

Dani AI

Generated

Two practical directions given the "local only, no PHP/MySQL" constraint: keep the message in the browser (per-machine persistence) or run a tiny local process that reads/writes a file so the message is shared between browsers on that machine. was pointing toward the latter requirement for a shared file, and hinted at client-side storage — both are valid depending on whether the message must be global or just local to one browser.

For a simple, per-browser solution use the browser storage APIs (persistent, easy, no server). localStorage is the easiest for a single text string and works across page loads on the same origin; IndexedDB is available for larger or structured data. This is ideal when the site will only ever be used on the same machine and you do not need a central shared file. See localStorage details here: localStorage.

If the message must live in a single file that any browser on the machine can edit, run a lightweight local server that accepts the edited text and writes it to disk. That server can be written in many languages (Python, Node, Java). On most systems a tiny Python-based HTTP handler is the quickest route; the Python standard docs are here: http.server. Notes: run the server with appropriate file permissions, consider simple authentication if others can access the machine, and keep backups of the file if the content is important.

Example client-side pattern (localStorage) and a small server approach will get this done quickly; pick client-only for per-browser simplicity, or a local server when a single shared file is required.

Recommended Answers

All 3 Replies

You can't do this with javascript. You need to use a server-side programming language that has access to the file system.

I agree. Anything done client-side would store a value on the client's computer, not the server.

If you want to store it client side, Javascript could make a cookie.

Okay. Well thanks for answers.. :) I'll try to work something out

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.