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>
Passing an array with URL
Moderator: General Moderators
- hob_goblin
- Forum Regular
- Posts: 978
- Joined: Sun Apr 28, 2002 9:53 pm
- Contact:
it looks like the 'counter' variable isn't being passed...
why don't you try:
it will just add on to the array
why don't you try:
Code: Select all
echo "<input type="text" name="columnsї]" size="15" >";Hi!
I tried
with no success! Any other ideas??? 
I tried
Code: Select all
echo "<input type="text" name="columnsї]" size="15" >";Code: Select all
<?php
<HTML>
<HEAD>
<TITLE>Get column names</TITLE>
</HEAD>
<BODY>
<?
var $columns;
$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>
?>Hi!
Inclusion of
generates a parse error
Parse error: parse error, unexpected T_VAR in c:\program files\apache group\apache\htdocs\test\get_col_names.php on line 7 ... so it doesn't seem to be working... but thanks anyway!
Inclusion of
Code: Select all
var $columns;Parse error: parse error, unexpected T_VAR in c:\program files\apache group\apache\htdocs\test\get_col_names.php on line 7 ... so it doesn't seem to be working... but thanks anyway!
sorry guys {...sitting here petty sh@tfaced..}
mistyped the array name in the script the array is referred to! it's working now!!
Thanks - again and soorry for the time wasted!
Fari
Thanks - again and soorry for the time wasted!
Fari