there is a problem in some admin forms i built passing variables through forms to some code to be processed, 9 times out of 10, it compounds the first variable (only the first.) with the others, and still outputs the others normally.
so the form has two inputs and a submit button:
<FORM METHOD="post" ACTION="set_fields.php">
<P CLASS="item">Table Name:<BR>
<INPUT TYPE="text" NAME="table_name" SIZE=30></P>
<P CLASS="item">Number of Fields:<BR>
<INPUT TYPE="text" NAME="num_fields" SIZE=5></P>
<P><INPUT TYPE="submit" NAME="submit" VALUE="Go to Step 2"></P>
</FORM>
the variables are passed along to set_fields.php, except that $table_name becomes a compound version of all three fields (including the submit button) almost like URL variables....
if i put in 'news' as the table name and let it have '8' as the number of fields, the table name variable becomes:
news&num_fields=8&submit=Go+to+Step+2
when echoed out.
the set_fields.php looks something like this:
<?
if ((!$table_name) || (!$num_fields)) {
header( "Location: URL HERE");
exit;
}
$form_block = "
<FORM METHOD=\"post\" ACTION=\"do_make_table.php\">
<INPUT TYPE=\"hidden\" NAME=\"table_name\" VALUE=\"$table_name\">
<TABLE CELLSPACING=5 CELLPADDING=5 BORDER=0>
<TR>
<TH CLASS=\"item\">Field Name</TH>
<TH CLASS=\"item\">Field Type</TH>
<TH CLASS=\"item\">Field Length</TH>
<TH CLASS=\"item\">Primary Key?</TH>
<TH CLASS=\"item\">Auto-Increment?</TH>
</TR>
";
for ($i = 0; $i < $num_fields; $i++) {
$form_block .= "
// loop to create the inputs based on the $num_fields variable
}
$form_block .= "
<TR>
<TD ALIGN=center COLSPAN=3><INPUT TYPE=\"submit\" VALUE=\"Create Table\"></TD>
</TR>
</TABLE>
</FORM>
";
?>
<HTML>
<HEAD>
<TITLE>Create a Database Table: Step 2</TITLE>
<LINK REL="stylesheet" TYPE="text/css" HREF="admin_styles.css">
</HEAD>
<BODY>
<P CLASS="pagetitle">Define Fields for <? echo "$table_name"; ?></P>
<? echo "$form_block"; ?>
</BODY>
</HTML>
any suggestions would be greatly appreciated!