-if($_GET['action'] == "http"){
- $todelete[$time][] = array("http", $t1);
- file_put_contents("cacert-$t1.txt", $t2);
-} else if($_GET['action'] == "dns") {
- $todelete[$time][] = array("dns", $t1);
- $dnscalls .= "update delete {$t1}._cacert._auth." . ZONENAME . " TXT\n"
- ."update add {$t1}._cacert._auth." . ZONENAME . " 60 TXT {$t2}\n";
-}
-$copy = $todelete;
-foreach($copy as $nt => $ar){
- if($nt < $time - 2){
- unset($todelete[$nt]);
- foreach($ar as $act){
- if($act[0] == "http"){
- unlink("cacert-{$act[1]}.txt");
- } else if($act[0] == "dns") {
- $dnscalls .= "update delete {$act[1]}._cacert._auth." . ZONENAME . " TXT\n";
- }
- }
+/* fetch value */
+while($stmt->fetch()){
+ if($type == "http"){
+ unlink(".well-known/$appIdentifier-challenge/{$name}.txt");
+ } else if($type == "dns") {
+ $dnscalls .= "update delete {$name}._$appIdentifier._auth." . ZONENAME . " TXT\n";