add_record.php
changeset 79 0c0aa144356a
parent 71 e1b918eaf69a
child 82 c255196bc447
--- a/add_record.php	Mon Mar 03 20:32:33 2008 +0000
+++ b/add_record.php	Mon Mar 10 19:15:59 2008 +0000
@@ -26,7 +26,7 @@
 	error(ERR_RECORD_ACCESS_DENIED);
 }
 
-if ($_POST["commit"]) {
+if (isset($_POST["commit"]) && isset($_POST['zoneid']) && isset($_POST['name']) && isset($_POST['type']) && isset($_POST['content']) && isset($_POST['ttl']) && isset($_POST['prio']) ) {
         $ret = add_record($_POST["zoneid"], $_POST["name"], $_POST["type"], $_POST["content"], $_POST["ttl"], $_POST["prio"]);
         if ($ret != '1') {
                 die("$ret");
@@ -63,7 +63,7 @@
         } elseif (strtoupper($c) == 'A') {
                 $add = " SELECTED";
         } else {
-                unset($add);
+                $add = '';
         }
         ?><option<?php echo $add ?> value="<?php echo $c ?>"><?php echo $c ?></option><?php
 }