0) ) { $xml = "\r\n" .''; foreach($_POST['sensor'] as $sensor => $value) { $val = explode(":", $value); if(count($types)<>0 && !in_array($val[2], $types)) {$error2 = true;} else {$types[] = $val[2];} $xml = $xml. '' . '' . htmlspecialchars($val[0]) . '' . '' . htmlspecialchars($val[1]) . '' . ''; $xml = $xml."\r\n"; } $xml = $xml.''; if(!$error2) {file_put_contents('upload/sensor.xml', $xml) ;} }*/ if(isset($_POST['sensor']) && count($_POST['sensor']<>0)) { $ini = ""; $arduino_simple = "[Arduino]\r\n"; $arduino_spi = "[Arduino_spi]\r\n"; $nucleo = "[Nucleo]\r\n"; $a_simple = false; $a_spi = false; $n = false; foreach($_POST['sensor'] as $sensor => $value) { $val = explode(":", $value); if(count($types)<>0 && !in_array($val[2], $types)) {$error = true;} else {$types[] = $val[2];} $version = 1;//getSensorVersion($val[0], $val[1]); if($version == 0) { $a_simple = true; $arduino_simple = $arduino_simple.$val[0]." capteur=".$val[1]."\n"; } elseif($version == 1) { $a_spi = true; $arduino_spi = $arduino_spi.$val[0]." capteur=".$val[1]."\n"; } elseif($version == 2) { $n = true; $nucleo = $nucleo.$val[0]." capteur=".$val[1]."\n"; } } echo $arduino_simple; echo $arduino_spi; echo $nucleo; if($a_simple) {$ini = $ini.$arduino_simple."\n";} if($a_spi) {$ini = $ini.$arduino_spi."\n";} if($n) {$ini = $ini.$nucleo."\n";} if(!$error) {file_put_contents('upload/inventaire.ini', $ini);} } ?>

Envoi du fichier en ligne

Informations complémentaires

Nom du fichier
Type
Localisation
Erreur
Taille

Envoi du fichier en ligne