I'm not sure that your construct will work; however, you could always do
echo $HTTP_POST_VARS[$table_array[$iCnt][0]];
in place of 'echo $$var' or
$var = 'HTTP_POST_VARS';
echo ${$var}[$table_array[$iCnt][0]];
When using variable variables, the array index - here, 'ld_val' might
not be interpreted correctly; I'm guessing that PHP is looking for a
variable named 'HTTP_POST_VARS["ld_val"]', not an element of the
HTTP_POST_VARS array. More info is at
http://www.php.net/manual/en/language.variables.variable.php
On the other hand, are you absolutely sure that something (other than
whitespace) is actually IN $HTTP_POST_VARS['ld_val'] ??
- steve
At 5:36 PM +0000 7/23/01, [EMAIL PROTECTED] wrote:
>Please forgive my probably newbie question...
>I am cycling thru my database using a SQL describe statement and then
>am getting values from a form based upon the field name I find. This
>is working up 'til I try to read the form data.
>
>I have defined a variable like this:
> $var = $prefix.$table_array[$iCnt][0].$postfix;
>
>If I echo $var the printed result is:
> HTTP_POST_VARS["Id_val"]
>
>This is perfect because I want to access a field on the submitted form
>named "Id_val", but when I try echoing with a $$ like this:
> echo $$var
>
>I get nothing. I was under the impression that I could access my
>variable this way. Am I missing something basic here??
>
>Thanks!
>
>Mark
>
--
+------ Factoid: Of the 100 largest economies in the world, 51 are ------+
| Steve Edberg University of California, Davis |
| [EMAIL PROTECTED] Computer Consultant |
| http://aesric.ucdavis.edu/ http://pgfsun.ucdavis.edu/ |
+--- corporations ------ http://www.ips-dc.org/reports/top200text.htm ---+
--
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]