Fix left frame reloading after dropping table (bug #1034531).
[phpmyadmin/crack.git] / db_details_common.php
blobc0878214dac0036973287f4706114b497659e1d5
1 <?php
2 /* $Id$ */
3 // vim: expandtab sw=4 ts=4 sts=4:
5 /**
6 * Gets some core libraries
7 */
8 require_once('./libraries/grab_globals.lib.php');
9 require_once('./libraries/common.lib.php');
10 require_once('./libraries/bookmark.lib.php');
12 PMA_checkParameters(array('db'));
14 /**
15 * Defines the urls to return to in case of error in a sql statement
17 $err_url_0 = 'main.php?' . PMA_generate_common_url();
18 $err_url = $cfg['DefaultTabDatabase'] . '?' . PMA_generate_common_url($db);
21 /**
22 * Ensures the database exists (else move to the "parent" script) and displays
23 * headers
25 if (!isset($is_db) || !$is_db) {
26 // Not a valid db name -> back to the welcome page
27 if (!empty($db)) {
28 $is_db = PMA_DBI_select_db($db);
30 if (empty($db) || !$is_db) {
31 PMA_sendHeaderLocation($cfg['PmaAbsoluteUri'] . 'main.php?' . PMA_generate_common_url('', '', '&') . (isset($message) ? '&message=' . urlencode($message) : '') . '&reload=1');
32 exit;
34 } // end if (ensures db exists)
36 /**
37 * Changes database charset if requested by the user
39 if (isset($submitcollation) && !empty($db_collation) && PMA_MYSQL_INT_VERSION >= 40101) {
40 list($db_charset) = explode('_', $db_collation);
41 $sql_query = 'ALTER DATABASE ' . PMA_backquote($db) . ' DEFAULT' . PMA_generateCharsetQueryPart($db_collation);
42 $result = PMA_DBI_query($sql_query);
43 $message = $strSuccess;
44 unset($db_charset, $db_collation);
47 // Displays headers
48 if (!isset($message)) {
49 $js_to_run = 'functions.js';
50 require_once('./header.inc.php');
51 // Reloads the navigation frame via JavaScript if required
52 if (isset($reload) && $reload) {
53 echo "\n";
55 <script type="text/javascript" language="javascript1.2">
56 <!--
57 var hashformDone = false;
58 function hashformReload() {
59 <?php
60 if ($cfg['QueryFrame'] && $cfg['QueryFrameJS']) {
62 if (hashformDone != true) {
63 if (typeof(window.parent.frames['queryframe'].document.hashform.hash) != 'undefined' && typeof(window.parent.frames['nav']) != 'undefined') {
64 window.parent.frames['nav'].location.replace('./left.php?<?php echo PMA_generate_common_url('', '', '&');?>&hash=' +
65 window.parent.frames['queryframe'].document.hashform.hash.value);
66 hashformDone = true;
67 } else {
68 setTimeout("hashformReload();",500);
71 <?php
72 } else {
74 window.parent.frames['nav'].location.replace('./left.php?<?php echo PMA_generate_common_url('', '', '&');?>&hash=' +
75 '<?php echo md5($cfg['PmaAbsoluteUri']); ?>');
76 <?php
80 setTimeout("hashformReload();",500);
81 //-->
82 </script>
83 <?php
85 echo "\n";
86 } else {
87 PMA_showMessage($message);
90 /**
91 * Set parameters for links
93 $url_query = PMA_generate_common_url($db);