diff --git a/db_details.php3 b/db_details.php3 index 8383d3b29..6b6e0e40e 100755 --- a/db_details.php3 +++ b/db_details.php3 @@ -3,14 +3,25 @@ /** - * Gets the variables sent to this script and displays headers + * Gets some core libraries, ensures the database exists (else move to the + * "parent" script) and diplays headers */ require('./grab_globals.inc.php3'); +require('./lib.inc.php3'); +// Not a valid db name -> back to the welcome page +if (!empty($db)) { + $is_db = @mysql_select_db($db); +} +if (empty($db) || !$is_db) { + header('Location: ' . $cfgPmaAbsoluteUri . 'main.php3?lang=' . $lang . '&server=' . $server . (isset($message) ? '&message=' . urlencode($message) : '') . '&reload=1'); + exit(); +} +// Displays headers if (!isset($message)) { $js_to_run = 'functions.js'; include('./header.inc.php3'); // Reloads the navigation frame via JavaScript if required - if (!empty($reload) && $reload == 'true') { + if (isset($reload) && $reload) { echo "\n"; ?>