Hey, don't cop-the-hump. The reason I said you should go and read the manual is because this is difficult to get your head around and I thought the manual explained it better than I ever could. And yes lots of newbies don't even know where the manual is, or how to search it if they do; so I did the search and gave you the link. If I wanted to be rude I'd have just said RTFM (read the effing manual).
So, as I understand it, you have a presentation script that you want to work with dynamic and indeterminate data fields. My guess is that actually the data could be submitted from various forms written by various people, and possibly posted form various domains. So you have no certainty over what will be posted to your script, either the number or the names of the vars.
2 ways to handle that.
POST submits an array and you can just use the array handling constructs like foreach
foreach ($_POST as $key=>$val) {
echo '<td><input type="text" name="' . $key . '" maxlength="60" size="30" value="' . $val . '" /></td>';
}
That will output all fields posted no matter how many or what their names. You could add IFs or a SWITCH to eliminate unwanted vars like $_POST['submit'].
Now, the way you were approaching this will not work. Using variable variables you get the contents of $var_name as the name of a new var
// if $var_name holds the value 'David' then
$$var = $var_name;
// will give you a var named $David, and it will be empty
echo ${$var};
// will output nothing because you have not yet given it a value
What yu are tryuing to do is to alias $var_name so that you can use standard code for variable content. The foreach construct is the best way I know to handle that. There are various other array handling functions that can achieve the same. but they are less efficient.