A form is created dynamically using the fields available from a table. I'll assume one field to eliminate the for loop.
Code: Select all
$fields = mysql_list_fields($dbname, $table, $link);
$i = 0;
$field_arrayї$i] = mysql_field_name($fields, $i);
print "e;<input type=text name=$field_arrayї$i]>"e;;
//Let's say it generates a text field with the name=ID.Code: Select all
echo $ID;
//This works, but I won't always know the
//name of the form field since it's created dynamically
$form_arrayї$i] = "e;$"e;. $field_arrayї$i];
$str = $form_arrayї$i];
echo $form_arrayї$i];
echo $str;
//This outputs "e;$ID$ID"e; instead of the value
$str2 = $field_arrayї$i];
echo $field_arrayї$i];
echo $str2;
//This outputs "e;IDID"e; instead of the value.