Fixed bug #444352 (Data Missing/POST Error)

This commit is contained in:
Loïc Chapeaux
2001-09-23 15:31:50 +00:00
parent 3994cdc76b
commit e726fe785d
25 changed files with 416 additions and 211 deletions

View File

@@ -12,6 +12,16 @@ if (isset($submit)) {
require('./header.inc.php3');
/**
* Defines the url to return to in case of error in a sql statement
*/
$err_url = 'tbl_properties.php3'
. '?lang=' . $lang
. '&server=' . $server
. '&db=' . urlencode($db)
. '&table=' . urlencode($table);
/**
* Selects the database to work with
*/
@@ -34,7 +44,7 @@ if (isset($submit)) {
$field_name[$i] = stripslashes($field_name[$i]);
}
if (MYSQL_INT_VERSION < 32306) {
check_reserved_words($field_name[$i]);
check_reserved_words($field_name[$i], $err_url);
}
$query = backquote($field_name[$i]) . ' ' . $field_type[$i];
if ($field_length[$i] != '') {
@@ -180,7 +190,7 @@ if (isset($submit)) {
}
// Executes the query
$result = mysql_query($sql_query) or mysql_die();
$result = mysql_query($sql_query) or mysql_die('', '', '', $err_url);
$sql_query = $query_cpy . ';';
unset($query_cpy);
$message = $strTable . ' ' . htmlspecialchars($table) . ' ' . $strHasBeenCreated;
@@ -198,11 +208,11 @@ else {
}
// No table name
if (!isset($table) || trim($table) == '') {
mysql_die($strTableEmpty);
mysql_die($strTableEmpty, '', '', $err_url);
}
// No valid number of fields
else if (empty($num_fields) || !is_int($num_fields)) {
mysql_die($strFieldsEmpty);
mysql_die($strFieldsEmpty, '', '', $err_url);
}
// Table name and number of fields are valid -> show the form
else {
@@ -211,7 +221,7 @@ else {
$table = stripslashes($table);
}
if (MYSQL_INT_VERSION < 32306) {
check_reserved_words($table);
check_reserved_words($table, $err_url);
}
$action = 'tbl_create.php3';