Show only errors with file upload by default

This commit is contained in:
Jakub Vrana 2011-03-28 00:56:48 +02:00
parent 869193fa18
commit 63f197213e

View file

@ -175,7 +175,10 @@ if ($_POST) {
}
textarea("query", $q, 20);
echo ($_POST ? "" : "<script type='text/javascript'>document.getElementsByTagName('textarea')[0].focus();</script>\n");
echo "<p>" . (ini_bool("file_uploads") ? lang('File upload') . ': <input type="file" name="sql_file"> (&lt; ' . ini_get("upload_max_filesize") . 'B)' : lang('File uploads are disabled.')); // ignore post_max_size because it is for all form fields together and bytes computing would be necessary
echo "<p>" . (ini_bool("file_uploads")
? lang('File upload') . ': <input type="file" name="sql_file"' . ($_FILES && $_FILES["sql_file"]["error"] != 4 ? '' : ' onchange="this.form[\'only_errors\'].checked = true;"') . '> (&lt; ' . ini_get("upload_max_filesize") . 'B)' // ignore post_max_size because it is for all form fields together and bytes computing would be necessary
: lang('File uploads are disabled.')
);
?>
<p>