add warning if table name empty

This commit is contained in:
Steve Alberty
2001-07-31 09:30:11 +00:00
parent 047acbf862
commit a026e490ca
2 changed files with 130 additions and 113 deletions

View File

@@ -5,6 +5,9 @@ phpMyAdmin - Changelog
$Id$ $Id$
$Source$ $Source$
2001-07-31 Steve Alberty <alberty@neptunlabs.de>
* tbl_create.php3: add warning if table name empty
2001-07-30 Marc Delisle <lem9@users.sourceforge.net> 2001-07-30 Marc Delisle <lem9@users.sourceforge.net>
* merge Loic's version to cvs * merge Loic's version to cvs
* spanish.inc.php3 updates, thanks to * spanish.inc.php3 updates, thanks to

View File

@@ -16,9 +16,15 @@ mysql_select_db($db);
/** /**
* A new name has been submitted -> do the work
*/
if (isset($num_fields)) $num_fields=intval($num_fields);
if (isset($table) && trim($table) != '' && !empty($num_fields)) {
/**
* The form used to define the structure of the table has been submitted * The form used to define the structure of the table has been submitted
*/ */
if (isset($submit)) { if (isset($submit)) {
if (!isset($query)) { if (!isset($query)) {
$query = ''; $query = '';
} }
@@ -130,18 +136,26 @@ if (isset($submit)) {
$message = $strTable . ' ' . htmlspecialchars($table) . ' ' . $strHasBeenCreated; $message = $strTable . ' ' . htmlspecialchars($table) . ' ' . $strHasBeenCreated;
include('./tbl_properties.php3'); include('./tbl_properties.php3');
exit(); exit();
} // end do create table } // end do create table
/** /**
* Displays the form used to define the structure of the table * Displays the form used to define the structure of the table
*/ */
else { else {
$action = 'tbl_create.php3'; $action = 'tbl_create.php3';
include('./tbl_properties.inc.php3'); include('./tbl_properties.inc.php3');
// Diplays the footer // Diplays the footer
echo "\n"; echo "\n";
include('./footer.inc.php3'); include('./footer.inc.php3');
}
/**
* No new name for the table!
*/
}
else {
if (!isset($table) || trim($table) == '') mysql_die($strTableEmpty);
else if (empty($num_fields) || !is_int($num_fields)) mysql_die($strFieldsEmpty);
} }
?> ?>