I have a page that I am using on a Raspberry Pi that I use for turning relays on and off. I have a piece of code that I want to be able to change the button in the form by the status of (in this case) the input of whether the door is closed or not. Here is the code as it is now:
<?php $state = "Closed"; $state = "Open"; $pinStatus = trim(shell_exec("gpio -g read 21")); echo "<h3 style=\"font-color: #ff0000;\">South Door - $state[$pinStatus]</h3>"; ?> </h3></th> <th><h3>Relay Page</h3></th> </tr> <tr> <th><h3><form action= "" method="post"> <p> <button name="northdoor"; button type="submit" style="background-color:transparent; border-color:transparent;"> <img src="imgs/On_Button.png" height="125"/> </button> </p> </form> </h3></th>
When the status is Closed I want the button to be Off_Button.png and when it is Open I want it to be On_button.png. I am getting the status of the door to another part of this page.
Thanks for any ideas.