"; if ($status == "ON"){ echo "Starting to turn $object ON...."; if ($password == "password"){ echo "the password is correct: turn $object $status: "; $myFile = "stat.php"; $fh = fopen($myFile, 'w') or die("can't open file"); $stringData = ""'."\n"; fwrite($fh, $stringData); $stringData = "?>\n"; fwrite($fh, $stringData); fclose($fh); echo "FILE WRITE - PASS - $object ACTIVATED"; }else{ echo "the password is false"; echo "$object status not turning to $status"; } } if ($status == "OFF"){ echo "Starting to turn the $object OFF...."; if ($password == "password"){ echo "the password is correct: turn $object $status: "; $myFile = "stat.php"; $fh = fopen($myFile, 'w') or die("can't open file"); $stringData = ""'."\n"; fwrite($fh, $stringData); $stringData = "?>\n"; fwrite($fh, $stringData); fclose($fh); echo "FILE WRITE - PASS - $object DEACTIVATED"; }else{ echo "the password is false"; echo "$object status not turning to $status"; } } ?>