Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>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.</p> <p>Alternative way without a DB would be with files.</p> <p>If you don't wanna use mysql for this, you can use files. I suggest using ini files. For more on <a href="https://stackoverflow.com/questions/5695145/how-to-read-and-write-to-an-ini-file-with-php">how to read/write ini files, you can visit this question.</a> It's super simple and you'll be able to have each variable in a nifty array. </p> <p>What you need: A bit of PHP, a little bit of jQuery (or js), understanding of GET variables</p> <p>I suggest you create 3 files.</p> <blockquote> <p><strong>index.php</strong> :<br> Your main page which is the client. Pulls info using get variables. You can use jQuery.get() for this.</p> <p><strong>getstate.php</strong> :<br> 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 .</p> <p><strong>savestate.php</strong>:<br> This is the file which you'll send the new states to from index.php Example request: <a href="http://address.goes.here/savestate.php?bedroomlight=1&amp;garagelight=0" rel="nofollow noreferrer">http://address.goes.here/savestate.php?bedroomlight=1&amp;garagelight=0</a></p> </blockquote> <p>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)</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload