1
0
mirror of https://github.com/vrana/adminer.git synced 2025-08-10 08:34:20 +02:00

Simplify initializing post variables

This commit is contained in:
Jakub Vrana
2013-05-08 08:43:15 -07:00
parent e99463b295
commit a09916737e
8 changed files with 93 additions and 89 deletions

View File

@@ -1,10 +1,12 @@
<?php
$row = $_POST;
if ($_POST && !$error) {
$link = preg_replace('~ns=[^&]*&~', '', ME) . "ns=";
if ($_POST["drop"]) {
query_redirect("DROP SCHEMA " . idf_escape($_GET["ns"]), $link, lang('Schema has been dropped.'));
} else {
$name = trim($_POST["name"]);
$name = trim($row["name"]);
$link .= urlencode($name);
if ($_GET["ns"] == "") {
query_redirect("CREATE SCHEMA " . idf_escape($name), $link, lang('Schema has been created.'));
@@ -18,9 +20,8 @@ if ($_POST && !$error) {
page_header($_GET["ns"] != "" ? lang('Alter schema') : lang('Create schema'), $error);
$row = $_POST;
if (!$row) {
$row = array("name" => $_GET["ns"]);
$row["name"] = $_GET["ns"];
}
?>