From 7cf0b196c8a070da44ced88d1f3dca790fb2f171 Mon Sep 17 00:00:00 2001 From: jakubvrana Date: Mon, 2 Jul 2007 15:49:46 +0000 Subject: [PATCH] Error SID Engine prefill git-svn-id: https://adminer.svn.sourceforge.net/svnroot/adminer/trunk@7 7c3ca157-0c34-0410-bff1-cbf682f78f5c --- create.inc.php | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/create.inc.php b/create.inc.php index 1657706b..86b7c773 100644 --- a/create.inc.php +++ b/create.inc.php @@ -3,7 +3,7 @@ $types = array("int"); //! if ($_POST["drop"]) { if (mysql_query("DROP TABLE " . idf_escape($_GET["create"]))) { $_SESSION["message"] = lang('Table has been dropped.'); - header("Location: " . substr($SELF, 0, -1)); + header("Location: " . substr($SELF, 0, -1) . (SID ? "&" . SID : "")); exit; } } elseif ($_POST) { @@ -19,21 +19,22 @@ if ($_POST["drop"]) { if (strlen($_GET["create"])) { if (mysql_query("ALTER TABLE " . idf_escape($_GET["create"]) . " RENAME TO " . idf_escape($_POST["name"]) . ", $status")) { $_SESSION["message"] = lang('Table has been altered.'); - header("Location: $SELF" . "table=" . urlencode($_POST["name"])); + header("Location: $SELF" . "table=" . urlencode($_POST["name"]) . (SID ? "&" . SID : "")); exit; } } elseif ($fields && mysql_query("CREATE TABLE " . idf_escape($_POST["name"]) . " (" . implode(", ", $fields) . ")$status")) { $_SESSION["message"] = lang('Table has been created.'); - header("Location: $SELF" . "table=" . urlencode($_POST["name"])); + header("Location: $SELF" . "table=" . urlencode($_POST["name"]) . (SID ? "&" . SID : "")); exit; } } -page_header(lang('Create table')); -echo "

" . lang('Create table') . "

\n"; +page_header(strlen($_GET["create"]) ? lang('Alter table') . ': ' . htmlspecialchars($_GET["create"]) : lang('Create table')); +echo "

" . (strlen($_GET["create"]) ? lang('Alter table') . ': ' . htmlspecialchars($_GET["create"]) : lang('Create table')) . "

\n"; if ($_POST) { - echo "

" . lang('Unable to operate table.') . "

\n"; //! mysql_error + echo "

" . lang('Unable to operate table') . ": " . htmlspecialchars(mysql_error()) . "

\n"; $collate = $_POST["collate"]; + $engine = $_POST["engine"]; //! prefill fields } elseif (strlen($_GET["create"])) { $row = mysql_fetch_assoc(mysql_query("SHOW TABLE STATUS LIKE '" . mysql_real_escape_string($_GET["create"]) . "'"));