how do I submit an array, to a form

How can I move the selected array[i], example myclan[3] to post to a
form on a different php file?
I can move signal varibles but I cant move part of the array, using my drop down. Please help

Heres part of my code, I am a beginner,doing my first week

<?php . Connection(,,,,,,) //varibales for my form $myclan[] = $_POST["$myclan[]"]; // [b]didn't work[/b] $gender[] = _POST["gender"]; // [b]this worked, using single string[/b] //put mysql into php array while ($row1 = mysql_fetch_array($row)) { $myclans[] = $row1[0]; $myclans[] = $row1[1]; } echo' ' ; echo'Select a Clan'; for($i = 0; $i < count($myclans); $i++) { echo''.$myclans[$i]."...........".$myclans[$i+1]''; $i++; } echo ''; . . . submit (you know what I mean) ?>

the right way is:
[php]$myclan = $_POST["$myclan"];
$gender = $_POST[“gender”];[/php]

the [] is just a special option to use the next numberic key to store the data in it. when assigning an array to another u shoudn’t use it.

the for loop looks strange. every second key holds a nex pair of variables, but $i incremented by one. $i++ sould be $i+=2
or even better: put the echo '<option… inside the while loop.

hope this helps, if u still have trouble please post the result of print_r($_POST) or the form witch is submitting the data.

Sponsor our Newsletter | Privacy Policy | Terms of Service