better fix from Loic
[phpmyadmin/crack.git] / db_details.php3
blobf3169b5b5584b796c86fdc98af1a6eda38f32b8b
1 <?php
2 /* $Id$ */
5 /**
6 * Runs common work
7 */
8 require('./db_details_common.php3');
9 $url_query .= '&amp;goto=db_details.php3';
11 /**
12 * Database work
14 if (isset($show_query) && $show_query == 'y') {
15 // This script has been called by read_dump.php3
16 if (isset($sql_query_cpy)) {
17 $query_to_display = $sql_query_cpy;
19 // Other cases
20 else if (get_magic_quotes_gpc()) {
21 $query_to_display = stripslashes($sql_query);
23 else {
24 $query_to_display = $sql_query;
26 } else {
27 $query_to_display = '';
31 /**
32 * Gets informations about the database and, if it is empty, move to the
33 * "db_details_structure.php3" script where table can be created
35 $sub_part = '';
36 require('./db_details_db_info.php3');
37 if ($num_tables == 0 && empty($db_query_force)) {
38 $is_info = TRUE;
39 include('./db_details_structure.php3');
40 exit();
43 // loic1: defines wether file upload is available or not
44 $is_upload = (PMA_PHP_INT_VERSION >= 40000 && function_exists('ini_get'))
45 ? ((strtolower(ini_get('file_uploads')) == 'on' || ini_get('file_uploads') == 1) && intval(ini_get('upload_max_filesize')))
46 // loic1: php 3.0.15 and lower bug -> always enabled
47 : (PMA_PHP_INT_VERSION < 30016 || intval(@get_cfg_var('upload_max_filesize')));
50 <!-- Query box, sql file loader and bookmark support -->
51 <a name="querybox"></a>
52 <form method="post" action="read_dump.php3"<?php if ($is_upload) echo ' enctype="multipart/form-data"'; echo "\n"; ?>
53 onsubmit="return checkSqlQuery(this)">
54 <input type="hidden" name="is_js_confirmed" value="0" />
55 <input type="hidden" name="lang" value="<?php echo $lang; ?>" />
56 <input type="hidden" name="convcharset" value="<?php echo $convcharset; ?>" />
57 <input type="hidden" name="server" value="<?php echo $server; ?>" />
58 <input type="hidden" name="db" value="<?php echo $db; ?>" />
59 <input type="hidden" name="pos" value="0" />
60 <input type="hidden" name="goto" value="db_details.php3" />
61 <input type="hidden" name="zero_rows" value="<?php echo htmlspecialchars($strSuccess); ?>" />
62 <input type="hidden" name="prev_sql_query" value="<?php echo ((!empty($query_to_display)) ? urlencode($query_to_display) : ''); ?>" />
63 <?php echo sprintf($strRunSQLQuery, $db) . ' ' . PMA_showDocuShort('S/E/SELECT.html'); ?>&nbsp;:<br />
64 <div style="margin-bottom: 5px">
65 <textarea name="sql_query" cols="<?php echo $cfg['TextareaCols'] * 2; ?>" rows="<?php echo $cfg['TextareaRows']; ?>" wrap="virtual"
66 onfocus="if (typeof(document.layers) == 'undefined' || typeof(textarea_selected) == 'undefined') {textarea_selected = 1; this.form.elements['sql_query'].select();}">
67 <?php echo ((!empty($query_to_display)) ? htmlspecialchars($query_to_display) : ''); ?>
68 </textarea><br />
69 <input type="checkbox" name="show_query" value="y" id="checkbox_show_query" checked="checked" />&nbsp;
70 <label for="checkbox_show_query"><?php echo $strShowThisQuery; ?></label><br />
71 </div>
72 <?php
73 // loic1: displays import dump feature only if file upload available
74 if ($is_upload) {
75 echo ' <i>' . $strOr . '</i> ' . $strLocationTextfile . '&nbsp;:<br />' . "\n";
77 <div style="margin-bottom: 5px">
78 <input type="file" name="sql_file" class="textfield" /><br />
79 </div>
80 <?php
81 } // end if
82 echo "\n";
84 // Bookmark Support
85 if ($cfg['Bookmark']['db'] && $cfg['Bookmark']['table']) {
86 if (($bookmark_list = PMA_listBookmarks($db, $cfg['Bookmark'])) && count($bookmark_list) > 0) {
87 echo " <i>$strOr</i> $strBookmarkQuery&nbsp;:<br />\n";
88 echo ' <div style="margin-bottom: 5px">' . "\n";
89 echo ' <select name="id_bookmark">' . "\n";
90 echo ' <option value=""></option>' . "\n";
91 while (list($key, $value) = each($bookmark_list)) {
92 echo ' <option value="' . $value . '">' . htmlentities($key) . '</option>' . "\n";
94 echo ' </select>' . "\n";
95 echo ' <input type="radio" name="action_bookmark" value="0" id="radio_bookmark0" checked="checked" style="vertical-align: middle" /><label for="radio_bookmark0">' . $strSubmit . '</label>' . "\n";
96 echo ' &nbsp;<input type="radio" name="action_bookmark" value="1" id="radio_bookmark1" style="vertical-align: middle" /><label for="radio_bookmark1">' . $strBookmarkView . '</label>' . "\n";
97 echo ' &nbsp;<input type="radio" name="action_bookmark" value="2" id="radio_bookmark2" style="vertical-align: middle" /><label for="radio_bookmark2">' . $strDelete . '</label>' . "\n";
98 echo ' <br />' . "\n";
99 echo ' </div>' . "\n";
103 // Encoding setting form appended by Y.Kawada
104 if (function_exists('PMA_set_enc_form')) {
105 echo PMA_set_enc_form(' ');
108 <input type="submit" name="SQL" value="<?php echo $strGo; ?>" />
109 </form>
112 <?php
114 * Displays the footer
116 echo "\n";
117 require('./footer.inc.php3');