Hi,

I'm in a quandary here.  I have a form which contains sever tables each
containing similar fields.  The number of tables are dynamic based on
vales I retrieve from a database.  Each table has the following fields:

$name
$phone
$fax

In order to differentiate the filed names in my form, I created a loop
and extended each field name with the loop iteration as such ($rownum is
my loop counter):

<snip>
<input type="text" name="name" . $rownum . ">"
<input type="text" name="phone" . $rownum . ">"
<input type="text" name="fax" . $rownum . ">"

So I would have field variables of:
$name1, $name2, $name3, ...
$phone1, $phone2, $phone3, ...
$fax1, $fax2, $fax3, ...

So far so good as I have verified that these fields exist.

Now, when the user clicks on the submit button, the form data gets
posted to a PHP script.  I wish to access the variables but here I am at
a loss.  I attempted the following code without success ($rownum is the
number of tables I created):

for ($i = 1; $i <= $rownum; $i++) {
  $field = "phone" . $i;
  $name =& $field;
  echo $field . ":" . $name . "\n";
}

The docs state that references are NOT pointers.  So....., how can I
access my variables?  I could not find any information on Macros or
Pointers.

Thanks,
Don




-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to