Fixed bug.
[phpmyadmin/crack.git] / queryframe.php3
blobbbbe30da371b31e9bc49be612658bb5eaccde40d
1 <?php
2 /* $Id$ */
3 // vim: expandtab sw=4 ts=4 sts=4:
6 /**
7 * Gets the variables sent to this script, retains the db name that may have
8 * been defined as startup option and include a core library
9 */
10 require('./libraries/grab_globals.lib.php3');
11 if (!empty($db)) {
12 $db_start = $db;
16 /**
17 * Gets a core script and starts output buffering work
19 require('./libraries/common.lib.php3');
20 require('./libraries/ob.lib.php3');
21 if ($cfg['OBGzip']) {
22 $ob_mode = PMA_outBufferModeGet();
23 if ($ob_mode) {
24 PMA_outBufferPre($ob_mode);
28 /**
29 * Send http headers
31 // Don't use cache (required for Opera)
32 $now = gmdate('D, d M Y H:i:s') . ' GMT';
33 header('Expires: ' . $now);
34 header('Last-Modified: ' . $now);
35 header('Cache-Control: no-store, no-cache, must-revalidate, pre-check=0, post-check=0, max-age=0'); // HTTP/1.1
36 header('Pragma: no-cache'); // HTTP/1.0
37 // Define the charset to be used
38 header('Content-Type: text/html; charset=' . $charset);
41 /**
42 * Displays the frame
44 // Gets the font sizes to use
45 PMA_setFontSizes();
47 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
48 "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
49 <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="<?php echo $available_languages[$lang][2]; ?>" lang="<?php echo $available_languages[$lang][2]; ?>" dir="<?php echo $text_dir; ?>">
51 <head>
52 <title>phpMyAdmin</title>
53 <meta http-equiv="Content-Type" content="text/html; charset=<?php echo $charset; ?>" />
54 <base<?php if (!empty($cfg['PmaAbsoluteUri'])) echo ' href="' . $cfg['PmaAbsoluteUri'] . '"'; ?> />
55 <style type="text/css">
56 <!--
57 body {font-family: <?php echo $left_font_family; ?>; font-size: <?php echo $font_size; ?>}
58 div {font-family: <?php echo $left_font_family; ?>; font-size: <?php echo $font_size; ?>; color: #000000}
59 .heada {font-family: <?php echo $left_font_family; ?>; font-size: <?php echo $font_size; ?>; color: #000000}
60 .headaCnt {font-family: <?php echo $left_font_family; ?>; font-size: <?php echo $font_smaller; ?>; color: #000000}
61 .parent {font-family: <?php echo $left_font_family; ?>; color: #000000; text-decoration: none}
62 .child {font-family: <?php echo $left_font_family; ?>; font-size: <?php echo $font_smaller; ?>; color: #333399; text-decoration: none}
63 .item, .item:active, .item:hover, .tblItem, .tblItem:active {font-size: <?php echo $font_smaller; ?>; color: #333399; text-decoration: none}
64 .tblItem:hover {color: #FF0000; text-decoration: underline}
65 //-->
66 </style>
67 <?php
68 if ($cfg['QueryFrame'] && $cfg['QueryFrameJS']) {
70 <script type="text/javascript" language="javascript">
71 var querywindow = '';
73 function open_querywindow(url) {
75 if (!querywindow.closed && querywindow.location) {
76 querywindow.focus();
77 } else {
78 querywindow=window.open(url + '&db=' + document.queryframeform.db.value + '&table=' + document.queryframeform.table.value, 'js_querywindow','toolbar=0,location=0,directories=0,status=1,menubar=0,scrollbars=yes,resizable=yes,width=750,height=500');
81 if (!querywindow.opener) {
82 querywindow.opener = self;
85 if (window.focus) {
86 querywindow.focus();
89 return false;
91 </script>
92 <?php
95 </head>
97 <body bgcolor="<?php echo $cfg['LeftBgColor']; ?>">
98 <form name="queryframeform" action="queryframe.php3" method="get">
99 <input type="hidden" name="db" value="" />
100 <input type="hidden" name="table" value="" />
101 <input type="hidden" name="framename" value="queryframe" />
102 </form>
104 <?php
105 $anchor = 'querywindow.php3?' . PMA_generate_common_url('', '');
106 if ($cfg['QueryFrameJS']) {
107 $href = '#';
108 $target = '';
109 $onclick = 'onClick="javascript:open_querywindow(\'' . $anchor . '\'); return false;"';
110 } else {
111 $href = $anchor;
112 $target = 'target="phpmain"';
113 $onclick = '';
116 <center>
117 <a href="<?php echo $href; ?>" <?php echo $target . ' ' . $onclick; ?>><?php echo $strQueryFrame; ?></a>
118 </center>
120 </body>
121 </html>
123 <?php
125 * Close MySql connections
127 if (isset($dbh) && $dbh) {
128 @mysql_close($dbh);
130 if (isset($userlink) && $userlink) {
131 @mysql_close($userlink);
136 * Sends bufferized data
138 if (isset($cfg['OBGzip']) && $cfg['OBGzip']
139 && isset($ob_mode) && $ob_mode) {
140 PMA_outBufferPost($ob_mode);