How to modify and save html/css in server-side?
I'm new in this subject so this might be a silly question for most of you. I have a simple server which several users will access. If any of them change a CSS property of an element, the others should be able to see the change in real time.
Should I use something like node.js to perform this? How do I save the changes the users do?
The page would look something like this: http://stom89.dyndns.org/
I guess what you want to change in your CSS / html , are states. Like if a lamp is on/off? Then you need to save each state in a mySQL DB and just grab the data for each user. If you want it to look like realtime for online users, then use js(ajax) to sync data regularly.
Alternative way without a DB would be with files.
If you don't wanna use mysql for this, you can use files. I suggest using ini files. For more on how to read/write ini files, you can visit this question. It's super simple and you'll be able to have each variable in a nifty array.
What you need: A bit of PHP, a little bit of jQuery (or js), understanding of GET variables
I suggest you create 3 files.
Your main page which is the client. Pulls info using get variables. You can use jQuery.get() for this.
This is the file which will read the ini file and give you back the states for each device. Read them with jQuery.get() from index.php .
This is the file which you'll send the new states to from index.php Example request: http://address.goes.here/savestate.php?bedroomlight=1&garagelight=0
Whats even more interesting is that ini files can be written/read easily by many programming languages so you can manipulate the data using your Raspberry Pi easily. (say someone turns of a light, a script polling state could change the ini file)