|
|
|||||||||
|
|||||||||
|
|||||||||
| |
|||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Display Modes |
|
#1
|
|||
|
|||
|
I am creating an array in file file1.php.
<?php echo("<br>"); echo("<form action=\"formcollect.php\" method=\"POST\" >"); echo(" "); for($k=0;$k<=15;$k++) {echo("<b><i>Comp</i></b>"); echo(" "); } echo("<br>"); for($i=0;$i<=15;$i++) { echo("<B><i>Comapny</i></b>"); for($j=0;$j<=$i;$j++) { echo(" "); echo("<input type=\"text\" name=\"rating[][]\" size=\"1\"> "); } echo("<br>"); } echo("<br>"); echo("<input type=\"submit\" value=\"SUBMIT\">"); echo("</form>"); ?> how can i access the elements of array in called script. |
|
#2
|
||||
|
||||
|
Although I don't think its proper to use [] in your input box names, I do believe it still works. Is there a reason you're doing multidimensional array?
Anyways, try adding this to your formcollect.php: print_r($_POST) It will print out the POST array which should give you a better understanding of what's happening... you could also try $_POST['rating'][0].... although I'm not positive of how the array is translated by PHP |
![]() |
| Viewing: Dev Articles Community Forums > Programming > PHP Development > FORm |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|