I am doing an apartment site for a guy using PHP, with a flat text file (I haven't learned MySQL yet). I want to allow up to 40 apts, up to 12 rooms each, each room has a price, a status (vacant or occupied), a description, a pet status, etc. A couple of fields like that, nothing huge.
My problem is trying to figure out how to use a PHP array passed through an HTML form. In other words, I want to pass an array with type = hidden. For example, instead of
print" < input type='hidden' name='A' value='$A' >";
print" < input type='hidden' name='B' value='$B' >";
print" < input type='hidden' name='C' value='$C' >";
print" < input type='hidden' name='D' value='$D' >";
I want to do this using a PHP array -- e.g. $T = array(3000)
print" < input type='hidden' name='T[1]' value='$T[1]' >";
print" < input type='hidden' name='T[2]' value='$T[2]' >";
print" < input type='hidden' name='T[3]' value='$T[3]' >";
print" < input type='hidden' name='T[4]' value='$T[4]' >";
Since I have 40 apts x 12 rooms each x 6 vars associated with each room = approx 3000 variables, if I can use an array I can specify a for loop and pass all the variables in one line in the loop -- e.g. $T[$i]. But I'm pretty sure the above T[1] T[2] ... $T[$i] etc won't work since arrays can't be specified in the HTML input name = field. Or can they?
So how can I pass this information as an array without naming each variable separately. Hope that's clear. I'm not that experienced with PHP and maybe there is an easier way to do this.
Phil P