Wpis z mikrobloga

Mirki, jak odpalić ten kod? Wrzuciłem jako html ale wyświetla sam tekst:

**UberFridge** programming arduino!

php
if ($_FILES["file"]["error"] 0)
{
echo "Error: " . $_FILES["file"]["error"] . "
";
}
else
{
echo "Uploaded **" . $_FILES["file"]["name"] . "** to the Arduino with avrdude";
echo " (size: " . ($_FILES["file"]["size"] / 1024) . " Kb)
";
}
?>

### avrdude output:
php
$filename = $_FILES["file"]["tmp_name"];
$file = escapeshellcmd($filename);
$output = shell_exec("LD_LIBRARY_PATH=\"\" avrdude -p m328p -c arduino -b 57600 -P /dev/usb/tts/0 -C /opt/etc/avrdude.conf -U flash:w:".trim($file)." 2&1");
?>

php
echo "<pre$output";
?>

#webdev #html #html5
  • 4