Passing an array with URL
Posted: Fri Sep 20, 2002 7:54 pm
Hi guys - my next dilemma:
this script gets variables $colno and $tabname from another script and these are correctly passed. Now I'm trying to gather strings into an array and pass this array onto conf_col_names.php, but there I get an undefined variable error if I refer to the array $columns. Any ideas why??? Please!
<HTML>
<HEAD>
<TITLE>Get column names</TITLE>
</HEAD>
<BODY>
<?
$columns[0]=$colno;
$columns[$colno+1]=$tabname;
echo"<font face=\"arial\" size=\"2\" color=\"#1c651c\">Table name : " . $columns[$colno+1] . "</font>" ;
echo "<BR><BR>";
echo"<font face=\"arial\" size=\"2\" color=\"#1c651c\">Column number : " . $columns[0] . "</font>" ;
$counter=1;
echo"<form action=\"conf_col_names.php\" method=\"post\">";
while ($counter < $colno+1)
{
echo "<BR>";
echo "<font face=\"arial\" size=\"2\" color=\"#1c651c\">Enter name of column " . $counter . " : </font>";
echo "<input type=\"text\" name=\"columns[$counter]\" size=\"15\" >";
$counter++;
}
echo"<BR>";
echo "<BR><input type=\"submit\" value=\"Enter\">";
echo "</form>";
?>
</BODY>
</HTML>
this script gets variables $colno and $tabname from another script and these are correctly passed. Now I'm trying to gather strings into an array and pass this array onto conf_col_names.php, but there I get an undefined variable error if I refer to the array $columns. Any ideas why??? Please!
<HTML>
<HEAD>
<TITLE>Get column names</TITLE>
</HEAD>
<BODY>
<?
$columns[0]=$colno;
$columns[$colno+1]=$tabname;
echo"<font face=\"arial\" size=\"2\" color=\"#1c651c\">Table name : " . $columns[$colno+1] . "</font>" ;
echo "<BR><BR>";
echo"<font face=\"arial\" size=\"2\" color=\"#1c651c\">Column number : " . $columns[0] . "</font>" ;
$counter=1;
echo"<form action=\"conf_col_names.php\" method=\"post\">";
while ($counter < $colno+1)
{
echo "<BR>";
echo "<font face=\"arial\" size=\"2\" color=\"#1c651c\">Enter name of column " . $counter . " : </font>";
echo "<input type=\"text\" name=\"columns[$counter]\" size=\"15\" >";
$counter++;
}
echo"<BR>";
echo "<BR><input type=\"submit\" value=\"Enter\">";
echo "</form>";
?>
</BODY>
</HTML>