From f9ca5659e7e493e78094ebf1b85a7dc34aaad268 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lo=C3=AFc=20Chapeaux?= Date: Fri, 7 Sep 2001 19:37:54 +0000 Subject: [PATCH] * optimisation round; * the 'location' header must be above any output! * $reload has now true boolean values --- db_details.php3 | 101 +++++++++++++++++++++++++++--------------------- 1 file changed, 56 insertions(+), 45 deletions(-) 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"; ?>