[PHP3] 2 dimensional arrays as form fields From: Mark Jeftovic (markjr <email protected>)
Date: 09/25/98

I have a form with some input fields being elements in a two dimensional array:

<input name="host_ip_rr[X][0]">
<input name="host_ip_rr[X][1]">
<input name="host_ip_rr[X][2]">

after i submit it i seem to able to detect that field[X] is set, and how
many elements are in it, but I can't seem to access the elements themselves.

$sub = $host_host[$i]; # $sub is now whatever "X" is above

for($x=0;$x<count($host_ip_rr);$x++) {
$k = key($host_ip_rr);
$rr_host = $host_ip_rr[$sub][$x]; # this should be the value of the input fld
print "$sub ~ $rr_host~$k<br>"; }

I get $k set to "oneoff.net.][0" when I do that. $sub is what it's supposed
to be. $rr_host is empty. I'd rather it be the value of the input field, that's
what I'm after in all this, the for loop is just debugging code at this point.

Is this even do-able?

-mark

---
Mark Jeftovic                   http://www.shmOOze.net/~markjr
Private World Communications:   http://www.PrivateWorld.com
Be the Master of Your Domain:   http://www.easyDNS.com

-- PHP 3 Mailing List http://www.php.net/ To unsubscribe send an empty message to php3-unsubscribe <email protected> To subscribe to the digest list: php3-digest-subscribe <email protected> For help: php3-help <email protected> Archive: http://www.php.net/mailsearch.php3