Move stuff to functions.inc.php

git-svn-id: https://adminer.svn.sourceforge.net/svnroot/adminer/trunk@80 7c3ca157-0c34-0410-bff1-cbf682f78f5c
This commit is contained in:
jakubvrana
2007-07-09 14:45:11 +00:00
parent 7427691286
commit 73e8631bf5
3 changed files with 85 additions and 69 deletions

View File

@@ -24,13 +24,14 @@ if ($_POST && $error) {
if (!$result) {
echo "<p class='error'>" . lang('Error in query') . ": " . htmlspecialchars(mysql_error()) . "</p>\n";
} elseif ($result === true) {
//~ if (token_delete()) {
//~ $token = token();
//~ }
/* more secure but less user-friendly
if (token_delete()) {
$token = token();
}
*/
echo "<p class='message'>" . lang('Query executed OK, %d row(s) affected.', mysql_affected_rows()) . "</p>\n";
} else {
select($result);
mysql_free_result($result);
}
}
}
@@ -42,6 +43,7 @@ if ($_POST && $error) {
echo "<p class='error'>" . lang('Unable to upload a file.') . "</p>\n";
}
?>
<form action="<?php echo htmlspecialchars($SELF); ?>sql=" method="post">
<p><textarea name="query" rows="20" cols="80"><?php echo htmlspecialchars($_POST["query"]); ?></textarea></p>
<p><input type="hidden" name="token" value="<?php echo $token; ?>" /><input type="submit" value="<?php echo lang('Execute'); ?>" /></p>