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

Execute SQL file stored on server disk

git-svn-id: https://adminer.svn.sourceforge.net/svnroot/adminer/trunk@1015 7c3ca157-0c34-0410-bff1-cbf682f78f5c
This commit is contained in:
jakubvrana
2009-08-25 15:58:04 +00:00
parent b349612063
commit b2a7c7ac62
5 changed files with 8 additions and 4 deletions

View File

@@ -8,7 +8,7 @@ if (!$error && $_POST["clear"]) {
page_header(lang('SQL command'), $error);
if (!$error && $_POST) {
$query = (isset($_POST["file"]) ? get_file("sql_file") : $_POST["query"]);
$query = ($_POST["webfile"] ? @file_get_contents("adminer.sql") : ($_POST["file"] ? get_file("sql_file") : $_POST["query"]));
if (is_string($query)) { // get_file() returns error as number
$query = str_replace("\r", "", $query); // parser looks for \n
$query = rtrim($query);
@@ -109,6 +109,8 @@ if (!ini_get("file_uploads")) {
<input type="submit" name="file" value="<?php echo lang('Run file'); ?>">
<?php } ?>
<p><?php echo lang('Webserver file %s', '<code>adminer.sql</code>'); ?> <input type="submit" name="webfile" value="<?php echo lang('Run file'); ?>">
<?php
if ($history) {
echo "<fieldset><legend>" . lang('History') . "</legend>\n";