fixed a bug with headers that may be sent after output

This commit is contained in:
Loïc Chapeaux
2001-11-16 14:07:24 +00:00
parent 6648ebaf6e
commit 81f94f9851
3 changed files with 92 additions and 23 deletions

View File

@@ -26,14 +26,17 @@ $err_url = 'db_details.php3'
* Ensures the database exists (else move to the "parent" script) and diplays
* headers
*/
// 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();
}
if (!isset($is_db) || !$is_db) {
// 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();
}
} // end if (ensures db exists)
// Displays headers
if (!isset($message)) {
$js_to_run = 'functions.js';