Fixed for quotes, HTML entities and other weird characters in db/table name.
[phpmyadmin/crack.git] / db_details_common.php3
blob9e62e8f1f10399c26376f74c81f7b81a1a147dbb
1 <?php
2 /* $Id$ */
3 // vim: expandtab sw=4 ts=4 sts=4:
5 /**
6 * Gets some core libraries
7 */
8 if (!defined('PMA_GRAB_GLOBALS_INCLUDED')) {
9 include('./libraries/grab_globals.lib.php3');
11 if (!defined('PMA_COMMON_LIB_INCLUDED')) {
12 include('./libraries/common.lib.php3');
14 if (!defined('PMA_BOOKMARK_LIB_INCLUDED')) {
15 include('./libraries/bookmark.lib.php3');
19 /**
20 * Defines the urls to return to in case of error in a sql statement
22 $err_url_0 = 'main.php3?' . PMA_generate_common_url();
23 $err_url = $cfg['DefaultTabDatabase'] . '?' . PMA_generate_common_url($db);
26 /**
27 * Ensures the database exists (else move to the "parent" script) and displays
28 * headers
30 if (!isset($is_db) || !$is_db) {
31 // Not a valid db name -> back to the welcome page
32 if (!empty($db)) {
33 $is_db = @PMA_mysql_select_db($db);
35 if (empty($db) || !$is_db) {
36 header('Location: ' . $cfg['PmaAbsoluteUri'] . 'main.php3?' . PMA_generate_common_url('', '', '&') . (isset($message) ? '&message=' . urlencode($message) : '') . '&reload=1');
37 exit();
39 } // end if (ensures db exists)
40 // Displays headers
41 if (!isset($message)) {
42 $js_to_run = 'functions.js';
43 include('./header.inc.php3');
44 // Reloads the navigation frame via JavaScript if required
45 if (isset($reload) && $reload) {
46 echo "\n";
48 <script type="text/javascript" language="javascript1.2">
49 <!--
50 window.parent.frames['nav'].location.replace('./left.php3?<?php echo PMA_generate_common_url($db, '', '&'); ?>');
51 //-->
52 </script>
53 <?php
55 echo "\n";
56 } else {
57 PMA_showMessage($message);
60 /**
61 * Set parameters for links
63 $url_query = PMA_generate_common_url($db);