$GerListARR[$nr]["Name"]=filter_var(file_get_contents(COMMAND."getswitchname&ain=".$GerListARR[$nr]["AIN"]),FILTER_SANITIZE_SPECIAL_CHARS,FILTER_FLAG_STRIP_LOW|FILTER_FLAG_STRIP_HIGH);
$GerListARR[$nr]["Name"]=trim(file_get_contents(COMMAND."getswitchname&ain=".$GerListARR[$nr]["AIN"]));

if ($_GET["schalter"]=="1") {
$output=shell_exec($an);
echo "1";
}
else {
echo "E";
}
<?php /*
Edi.php
*/
$user="admin";
$password="1234";
$ip="192.168.178.27:10000";
$Pfad="/var/media/ftp/Generic-Flash-Disk-01/apache-1341/htdocs";
$an=$Pfad.'/curl -d @'.$Pfad.'/on.xml http://'.$user.':'.$password.'@'.$ip.'/smartplug.cgi';
$aus=$Pfad.'/curl -d @'.$Pfad.'/off.xml http://'.$user.':'.$password.'@'.$ip.'/smartplug.cgi';
date_default_timezone_set('Europe/Berlin');
$ZeitG=date("HiNdmYI");
$Zeit=substr($ZeitG,0,13);
$ZeitM=date("HiNdmYI",mktime(substr($Zeit,0,2)+24,substr($Zeit,2,2),0,substr($Zeit,7,2),substr($Zeit,5,2),substr($Zeit,9,4)));
$DST=substr($ZeitG,13,1)*1;
$DSTM=substr($ZeitM,13,1)*1;
if ($_GET["schalter"]=="1") {
$output=shell_exec($an);
$dateihandle = fopen("Protokoll.txt","a+");
fwrite($dateihandle, "am ".date(d)."-".date(m)."-".date(y)." um ".date(H).":".date(i)." eingeschaltet
");
echo "1";
}
else {
echo "E";
}
if ($_GET["schalter"]=="0") {
$output=shell_exec($aus);
$dateihandle = fopen("Protokoll.txt","a+");
fwrite($dateihandle, "am ".date(d)."-".date(m)."-".date(y)." um ".date(H).":".date(i)." ausgeschaltet
");
echo "0";
}
else {
echo "E";
}
if ($_GET["schalter"]=="Taster") {
$output=shell_exec($an);
$dateihandle = fopen("Protokoll.txt","a+");
fwrite($dateihandle, "am ".date(d)."-".date(m)."-".date(y)." um ".date(H).":".date(i)." Taster ein
");
sleep(1);
$output=shell_exec($aus);
fwrite($dateihandle, "am ".date(d)."-".date(m)."-".date(y)." um ".date(H).":".date(i)." Taster aus
");
echo "Taster";
}
?>
<?php
/* Edi.php */
$user="admin";
$password="1234";
$ip="192.168.178.27:10000";
$Pfad="/var/media/ftp/Generic-Flash-Disk-01/apache-1341/htdocs";
$an=$Pfad.'/curl -d @'.$Pfad.'/on.xml http://'.$user.':'.$password.'@'.$ip.'/smartplug.cgi';
$aus=$Pfad.'/curl -d @'.$Pfad.'/off.xml http://'.$user.':'.$password.'@'.$ip.'/smartplug.cgi';
# Wenn in $edipowerstate eine 0 oder 1 stehen würde, dann...
$edipowerstate=$Pfad.'/curl -d @'.$Pfad.'/powerstate.xml http://'.$user.':'.$password.'@'.$ip.'/smartplug.cgi';
$Status="E";
if ($edipowerstate==$Status) {
$Status="N";
}
if ($_GET["schalter"]=="1" and $edipowerstate=="0") {
$output=shell_exec($an);
$Status="1";
}
if ($_GET["schalter"]=="0" and $edipowerstate=="1") {
$output=shell_exec($aus);
$Status="0";
}
$edipowerstate=$Pfad.'/curl -d @'.$Pfad.'/powerstate.xml http://'.$user.':'.$password.'@'.$ip.'/smartplug.cgi';
if ($edipowerstate!=$Status) {
$Status="E";
}
?>
<?xml version="1.0" encoding="UTF8"?><SMARTPLUG id="edimax"><CMD id="get"><Device.System.Power.State>[B]ON[/B]</Device.System.Power.State></CMD></SMARTPLUG>