Jsem uplny laik.
Jelikož v html programovat neumím, myslel jsem si že to přes tento program bude jednoduchší.
Našel jsem tento programek v jednom PC ve firmě a snažim se v něm udělat 1 stranku s gombiky.
Nikde jsem tu nevíděl zminku o spojeni s PHP.
Zajíma mně jak na to s klasickymi tlačitky Button a jak na to přes navigation bar.
Tady je stranka kterou mi udělal znamy a snažím se to použít v tomto programu.
Pomuže někdo?
Kód: Vybrat vše
<html>
<head>
<?php
if (isset($_POST['Button1']))
{
system('sudo /var/www/scripts/test.py > /dev/null &');
}
if (isset($_POST['Button2']))
{
exec('sudo python /var/www/red_off.py');
}
if (isset($_POST['Button3']))
{
exec('sudo python /var/www/gpio/yellow_on.py');
}
if (isset($_POST['Button4']))
{
exec('sudo python /var/www/gpio/yellow_off.py');
}
if (isset($_POST['Button5']))
{
exec('sudo python /var/www/gpio/green_on.py');
}
if (isset($_POST['Button6']))
{
exec('sudo python /var/www/gpio/green_off.py');
}
?>
<title></title>
</head>
<body>
<form method="post">
<table
style="width: 75%; text-align: left; margin-left: auto; margin-right: auto;"
border="0" cellpadding="2" cellspacing="2">
<tbody>
</tr>
<tr>
<td style="text-align: Left: 400;"><button name="Button1">Button 1</button></td> </tr>
<tr>
<td style="text-align: Left: 400;"><button name="Button2">Button 2</button></td>
</tr>
<tr>
<td style="text-align: Left: 400;"><button name="Button3">Button 3</button></td>
</tr>
<tr>
<td style="text-align: Left: 400;"><button name="Button4">Button 4</button></td>
</tr>
<tr>
<td style="text-align: Left: 400;"><button name="Button5">Button 5</button></td>
</tr>
<tr>
<td style="text-align: Left: 400;"><button name="Button6">Button 6</button></td>
</tr>
</tbody>
</table>
</form>
</body>
</html>