<?php
     system ( "gpio mode 0 out" );
     system ( "gpio write 0 1" );
	 
	 exec ( "gpio read 0", $status ); // retourne le resultat
     print_r ( $status );
	 
	 
	//waits 2 seconds
	sleep ( 2 );
	//turns off the LEDs
	for ($i = 0; $i <= 7; $i++ )
	{
     system ( "gpio write ".$i." 0" );
	}
	
	gpio mode 0 out
	gpio write 0 1
	gpio read 0

http://www.framboise314.fr/une-interface-web-simple-et-intuitive-pour-le-raspberry-pi-12/	
http://pautex.fr/domotique/raspberrypi.php
https://github.com/ronanguilloux/php-gpio
http://hackaday.com/2013/02/02/easy-web-interface-with-gpio-access-runs-on-raspberry-pi/
http://svbreakaway.info/tp-raspi-hwrc.php
?>

/***********************************************************************************/
<html>
<head>
<?php 
if (isset($_POST['RedON']))
{
exec('sudo python /var/www/red_on.py');
}
if (isset($_POST['RedOFF']))
{
exec('sudo python /var/www/red_off.py');
}
if (isset($_POST['YellowON']))
{
exec('sudo python /var/www/gpio/yellow_on.py');
}
if (isset($_POST['YellowOFF']))
{
exec('sudo python /var/www/gpio/yellow_off.py');
}
if (isset($_POST['GreenON']))
{
exec('sudo python /var/www/gpio/green_on.py');
}
if (isset($_POST['GreenOFF']))
{
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>
        <td style="text-align: center;">Turn LED on</td>
        <td style="text-align: center;">Turn LED off</td>
  </tr>
  <tr>
    <td style="text-align: center;"><button name="RedON">Red On</button></td>
    <td style="text-align: center;"><button name="RedOFF">Red Off</button></td>
  </tr>
  <tr>
    <td style="text-align: center;"><button name="YellowON">Yellow On</button></td>
    <td style="text-align: center;"><button name="YellowOFF">Yellow Off</button></td>
  </tr>
  <tr>
    <td style="text-align: center;"><button name="GreenON">Green On</button></td>
    <td style="text-align: center;"><button name="GreenOFF">Green Off</button></td>
  </tr>
</tbody>
  </table>
</form>
</body>
</html>
/***********************************************************************************/
import RPi.GPIO as GPIO
import time
GPIO.setmode(GPIO.BCM)
GPIO.setup(21,GPIO.OUT)
GPIO.output(21,1)
time.sleep(5)
GPIO.output(21,0)
GPIO.cleanup()

<?php
        if(isset($_GET['on'])){
                echo "on"
                exec('sudo python /var/www/led.py');
        }
        else if(isset($_GET['off'])){
                echo "off";
        }
?>
<html>
        <head>

        </head>
        <body>
                <form method="get">
                        <button name="on">on</button><br>
                        <button name="off">on</button><br>
                </form>
        </body>
</html>
/***********************************************************************************/

