diff --git a/admin/labels.php b/admin/labels.php
index 719534a1f79..745e4724085 100644
--- a/admin/labels.php
+++ b/admin/labels.php
@@ -310,7 +310,7 @@
echo "\t\t\t\t
\n"
."\t\t\t\t
\n";
+ echo "\n";
}
else
{
@@ -426,10 +431,13 @@ function modanswers($lid)
switch($_POST['method'])
{
case _ADD:
- $query = "INSERT INTO {$dbprefix}labels (lid, code, title, sortorder) VALUES ($lid, '{$_POST['code']}', '{$_POST['title']}', '{$_POST['sortorder']}')";
- if (!$result = mysql_query($query))
+ if (isset($_POST['code']) && $_POST['code'])
{
- echo "\n";
+ $query = "INSERT INTO {$dbprefix}labels (lid, code, title, sortorder) VALUES ($lid, '{$_POST['code']}', '{$_POST['title']}', '{$_POST['sortorder']}')";
+ if (!$result = mysql_query($query))
+ {
+ echo "\n";
+ }
}
break;
case _AL_SAVE: