]> git.joonet.de Git - adminer.git/commitdiff
Join SQL forms
authorjakubvrana <jakubvrana@7c3ca157-0c34-0410-bff1-cbf682f78f5c>
Mon, 15 Jun 2009 08:18:19 +0000 (08:18 +0000)
committerjakubvrana <jakubvrana@7c3ca157-0c34-0410-bff1-cbf682f78f5c>
Mon, 15 Jun 2009 08:18:19 +0000 (08:18 +0000)
git-svn-id: https://adminer.svn.sourceforge.net/svnroot/adminer/trunk@688 7c3ca157-0c34-0410-bff1-cbf682f78f5c

adminer/sql.inc.php

index eb1f61b619e1c2230ac77074eb9961d1f93e57ae..f350c2403916b4d5071577d7f1c6e8bda289c0e5 100644 (file)
@@ -2,7 +2,7 @@
 page_header(lang('SQL command'), $error);
 
 if (!$error && $_POST) {
-       if (is_string($query = (isset($_POST["query"]) ? $_POST["query"] : get_file("sql_file")))) {
+       if (is_string($query = (isset($_POST["file"]) ? get_file("sql_file") : $_POST["query"]))) {
                @set_time_limit(0);
                $query = str_replace("\r", "", $query);
                $delimiter = ";";
@@ -62,24 +62,22 @@ if (!$error && $_POST) {
 }
 ?>
 
-<form action="" method="post">
+<form action="" method="post" enctype="multipart/form-data">
 <p><textarea name="query" rows="20" cols="80" style="width: 98%;"><?php echo htmlspecialchars($_POST ? $_POST["query"] : (strlen($_GET["history"]) ? $_SESSION["history"][$_GET["server"]][$_GET["db"]][$_GET["history"]] : $_GET["sql"])); ?></textarea></p>
 <p>
 <input type="hidden" name="token" value="<?php echo $token; ?>" />
 <input type="submit" value="<?php echo lang('Execute'); ?>" />
 <label><input type="checkbox" name="error_stops" value="1"<?php echo ($_POST["error_stops"] ? " checked='checked'" : ""); ?> /><?php echo lang('Stop on error'); ?></label>
 </p>
-</form>
 
 <?php
 if (!ini_get("file_uploads")) {
        echo "<p>" . lang('File uploads are disabled.') . "</p>\n";
 } else { ?>
-<form action="" method="post" enctype="multipart/form-data">
 <p>
 <?php echo lang('File upload'); ?>: <input type="file" name="sql_file" />
 <input type="hidden" name="token" value="<?php echo $token; ?>" />
-<input type="submit" value="<?php echo lang('Execute'); ?>" />
+<input type="submit" name="file" value="<?php echo lang('Execute'); ?>" />
 </p>
 </form>
 <?php } ?>