common
This commit is contained in:
@@ -5,6 +5,10 @@ phpMyAdmin - Changelog
|
||||
$Id$
|
||||
$Source$
|
||||
|
||||
2002-04-28 Marc Delisle <lem9@users.sourceforge.net>
|
||||
* tbl_properties.php3, new tbl_properties_common.php3:
|
||||
start the split
|
||||
|
||||
2002-04-28 Alexander M. Turek <rabus@users.sourceforge.net>
|
||||
* header.inc.php3, lines 162-170: Improved patch #548696.
|
||||
|
||||
|
@@ -2,66 +2,10 @@
|
||||
/* $Id$ */
|
||||
|
||||
|
||||
/**
|
||||
* Gets some core libraries
|
||||
*/
|
||||
require('./libraries/grab_globals.lib.php3');
|
||||
require('./libraries/common.lib.php3');
|
||||
require('./libraries/bookmark.lib.php3');
|
||||
|
||||
require('./tbl_properties_common.php3');
|
||||
|
||||
/**
|
||||
* Defines the urls to return to in case of error in a sql statement
|
||||
*/
|
||||
$err_url_0 = 'db_details.php3'
|
||||
. '?lang=' . $lang
|
||||
. '&server=' . $server
|
||||
. '&db=' . urlencode($db);
|
||||
$err_url = 'tbl_properties.php3'
|
||||
. '?lang=' . $lang
|
||||
. '&server=' . $server
|
||||
. '&db=' . urlencode($db)
|
||||
. '&table=' . urlencode($table);
|
||||
|
||||
|
||||
/**
|
||||
* Ensures the database and the table exist (else move to the "parent" script)
|
||||
* and displays headers
|
||||
*/
|
||||
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: ' . $cfg['PmaAbsoluteUri'] . 'main.php3?lang=' . $lang . '&server=' . $server . (isset($message) ? '&message=' . urlencode($message) : '') . '&reload=1');
|
||||
exit();
|
||||
}
|
||||
} // end if (ensures db exists)
|
||||
if (!isset($is_table) || !$is_table) {
|
||||
// Not a valid table name -> back to the db_details.php3
|
||||
if (!empty($table)) {
|
||||
$is_table = @mysql_query('SHOW TABLES LIKE \'' . PMA_sqlAddslashes($table, TRUE) . '\'');
|
||||
}
|
||||
if (empty($table) || !@mysql_numrows($is_table)) {
|
||||
header('Location: ' . $cfg['PmaAbsoluteUri'] . 'db_details.php3?lang=' . $lang . '&server=' . $server . '&db=' . urlencode($db) . (isset($message) ? '&message=' . urlencode($message) : '') . '&reload=1');
|
||||
exit();
|
||||
} else if (isset($is_table)) {
|
||||
mysql_free_result($is_table);
|
||||
}
|
||||
} // end if (ensures table exists)
|
||||
|
||||
// Displays headers
|
||||
if (!isset($message)) {
|
||||
$js_to_run = 'functions.js';
|
||||
include('./header.inc.php3');
|
||||
} else {
|
||||
PMA_showMessage($message);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Drop/delete mutliple tables if required
|
||||
* Drop multiple fields if required
|
||||
*/
|
||||
if ((!empty($submit_mult) && isset($selected_fld))
|
||||
|| isset($mult_btn)) {
|
||||
|
71
tbl_properties_common.php3
Executable file
71
tbl_properties_common.php3
Executable file
@@ -0,0 +1,71 @@
|
||||
<?php
|
||||
/* $Id$ */
|
||||
|
||||
|
||||
/**
|
||||
* Gets some core libraries
|
||||
*/
|
||||
require('./libraries/grab_globals.lib.php3');
|
||||
require('./libraries/common.lib.php3');
|
||||
require('./libraries/bookmark.lib.php3');
|
||||
|
||||
|
||||
/**
|
||||
* Defines the urls to return to in case of error in a sql statement
|
||||
*/
|
||||
$err_url_0 = 'db_details.php3'
|
||||
. '?lang=' . $lang
|
||||
. '&server=' . $server
|
||||
. '&db=' . urlencode($db);
|
||||
$err_url = 'tbl_properties.php3'
|
||||
. '?lang=' . $lang
|
||||
. '&server=' . $server
|
||||
. '&db=' . urlencode($db)
|
||||
. '&table=' . urlencode($table);
|
||||
|
||||
|
||||
/**
|
||||
* Ensures the database and the table exist (else move to the "parent" script)
|
||||
* and displays headers
|
||||
*/
|
||||
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: ' . $cfg['PmaAbsoluteUri'] . 'main.php3?lang=' . $lang . '&server=' . $server . (isset($message) ? '&message=' . urlencode($message) : '') . '&reload=1');
|
||||
exit();
|
||||
}
|
||||
} // end if (ensures db exists)
|
||||
if (!isset($is_table) || !$is_table) {
|
||||
// Not a valid table name -> back to the db_details.php3
|
||||
if (!empty($table)) {
|
||||
$is_table = @mysql_query('SHOW TABLES LIKE \'' . PMA_sqlAddslashes($table, TRUE) . '\'');
|
||||
}
|
||||
if (empty($table) || !@mysql_numrows($is_table)) {
|
||||
header('Location: ' . $cfg['PmaAbsoluteUri'] . 'db_details.php3?lang=' . $lang . '&server=' . $server . '&db=' . urlencode($db) . (isset($message) ? '&message=' . urlencode($message) : '') . '&reload=1');
|
||||
exit();
|
||||
} else if (isset($is_table)) {
|
||||
mysql_free_result($is_table);
|
||||
}
|
||||
} // end if (ensures table exists)
|
||||
|
||||
// Displays headers
|
||||
if (!isset($message)) {
|
||||
$js_to_run = 'functions.js';
|
||||
include('./header.inc.php3');
|
||||
} else {
|
||||
PMA_showMessage($message);
|
||||
}
|
||||
|
||||
/**
|
||||
* Set parameters for links
|
||||
*/
|
||||
$url_query = 'lang=' . $lang
|
||||
. '&server=' . $server
|
||||
. '&db=' . urlencode($db)
|
||||
. '&table=' . urlencode($table)
|
||||
. '&goto=tbl_properties.php3';
|
||||
|
||||
?>
|
Reference in New Issue
Block a user