Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Dynamic Variables

Status
Not open for further replies.

Dronealone

IS-IT--Management
Mar 13, 2002
64
GB
Hello,

I am trying to dynamically build a variable name and then access the value that is in the variable, which has been posted by a form. My code is:

$var = "HTTP_POST_VARS[industry" . "_" . $db_row[name] . "]";

$val = $$var;

echo $val;

This doesn't give me any value. If I echo the variable name, which is being constructed correctly, I get the value. Does anybody know what I'm doing wrong?

Thanks!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top