After lurking for some years, I've finally created a user.
I'll try to explain my problem to you as good as I can:
I need a small browser friendly document (HTML, PHP, whatever) that enables me and a few colleagues to flip a switch so we can see if any drove to work. I can create the switch, and it works fine - however, I need it to keep it's state, spanning on several computers, and I was wondering if that is possible without making a DB?
I'd love to keep it simple, and in one file.
Example:
Dude1 comes to work, cycling. Switch is OFF
Dude2 comes to work, walking. Switch is OFF
Dude3 comes to work, driving. Switch is ON
--
Dude1 wants to see who's driving today. Opens the PHP/HTML and can see the status:
Dude1 - OFF
Dude2 - OFF
Dude3 - ON
I hope that explains my problem, if not please ask and I'll try to be clearer.
<div class="onoffswitch">
<input type="checkbox" name="onoffswitch" class="onoffswitch-checkbox" id="switch" checked>
<label class="onoffswitch-label" for="switch">
<span class="onoffswitch-inner"></span>
<span class="onoffswitch-switch"></span>
</label>
</div>
That was the easy part - now how to keep the state.
Edit, added a picture. enter image description here
$_SESSION(the latter is not recommended)file.php. Requirements for SQLite are a writable file and the php sqlite extension.