To Mods: you can delete the old post but please not this one - thx
How can I make $tn[$rownum] a REAL variable variable. "Variable variables" are not what I mean. Those make the variable names dynamic hence it does not help here. Everyone has tried to get variable variables to work and that is what is throwing us off. This is by far the hardest thing I've ever had to do because I never have had to think so hard ha. I made a seperate page called test.php just to figure out the concept we are trying to get. It's a lot cleaner so now maybe things will uh clear up.
<?
if ($cdform == "yes")
{
$rownum = 1;
while ($rownum <= $tracknum)
{
$trackname = "track".$rownum."name";
$tn[$rownum] = $trackname;
echo "TN is $tn[$rownum]<br>";
$rownum++;
}
}
?>
<form action="<? echo "$PHP_SELF"; ?>" method="post" ENCTYPE="multipart/form-data">
<input type="hidden" name="cdform" value="yes">
<table width=800>
<tr>
<td valign="top">Tracks:</td>
<td>
<center>
Number of Tracks: <select name="tracknum"><?
$opnum =1;
while ($opnum <= 50) { echo "<option value=$opnum"; if ($opnum == $tracknum) { echo " selected ";} echo ">$opnum</option>";$opnum++;}?></select><input type="submit" name="submitcd" value="Go">
</center>
<?
$rownum = 1;
while ($rownum <= $tracknum)
{
$trackname = "track".$rownum."name";
$tn[$rownum] = $trackname;
echo "$rownum) Name ($trackname): <input type='text' name='\"$trackname\"' size='30' maxlength='50' value='$tn[$rownum]'><br>";
$rownum++;
}
?>
</td>
</tr>
</table>
<input type="submit" name="submitcd" value="Submit Your CD">
</form>
Of course the problem is that as soon as i select a number of tracks, two for instance, it will instantly echo on the top "TN is trackname1 and TN is track2name" followed by the fields already having the values track1name and track2name. So seeing as this is day two, maybe someone else will find the answer. This is the entire code of test.php so you can try it on your servers and see. This is quite the brain teaser.