Simplified a bit the code
This commit is contained in:
@@ -16,15 +16,9 @@ mysql_select_db($db);
|
|||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* A new name has been submitted -> do the work
|
|
||||||
*/
|
|
||||||
if (isset($num_fields)) $num_fields=intval($num_fields);
|
|
||||||
if ((!isset($submit) && isset($table) && trim($table) != '' && !empty($num_fields)) || isset($submit)) {
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 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 = '';
|
||||||
}
|
}
|
||||||
@@ -136,26 +130,32 @@ if ((!isset($submit) && isset($table) && trim($table) != '' && !empty($num_field
|
|||||||
$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 {
|
||||||
|
if (isset($num_fields)) {
|
||||||
|
$num_fields = intval($num_fields);
|
||||||
|
}
|
||||||
|
// No table name
|
||||||
|
if (!isset($table) || trim($table) == '') {
|
||||||
|
mysql_die($strTableEmpty);
|
||||||
|
}
|
||||||
|
// No valid number of fields
|
||||||
|
else if (empty($num_fields) || !is_int($num_fields)) {
|
||||||
|
mysql_die($strFieldsEmpty);
|
||||||
|
}
|
||||||
|
// Table name and number of fields are valid -> show the form
|
||||||
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);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
?>
|
?>
|
||||||
|
Reference in New Issue
Block a user