RPi GPIO status update to php button and script
<p>I'm stump on some php code.</p>

<p>I currently have a button change color by getting GPIO status on a Raspberry pi3, Red when off Green when on, I'm stuck trying to get it to execute one of the two python scripts when the button changes color. I can get it scripts executed if I use two button one for on and one for off, Would rather have it one button when status color.</p>

<p>Thanks in advance for any help. </p>

<p>Everything I have tried the page won't load .
Below is what I have for status update.</p>

<pre><code>&lt;html&gt;
&lt;head&gt;
&lt;/head&gt;
&lt;body&gt;
&lt;?php $status1 = trim(shell_exec("gpio -g read 12")); ?&gt;
&lt;?php 
if ($status1 == "1") {
echo  "&lt;button  style=\"background-color:#FF0000; width: 400px; height:350px; font-size:60px;\"&gt;Relay 1&lt;/button&gt;";
}  else {
echo "&lt;button  style=\"background-color:#009900; width: 400px; height:350px; font-size:60px;\"&gt;Relay 1&lt;/button&gt;";
}
?&gt;
&lt;br&gt;
&lt;br&gt;
&lt;?php echo date('Y-m-d H:i:s'); ?&gt;
&lt;/body&gt;
&lt;/html&gt;
</code></pre>