Posted by Leszek on 02/01/06 15:20
I have a form with 5 dropdown lists I want to put all selected values to an
array called $data[] so i wrote sometthing like this:
for(i=0;i<5;i++){
echo"<select name=\"\$data[]\">";
echo"<option value=\"1\">1</option>";
echo"<option value=\"1\">2</option>";
echo"<option value=\"1\">3</option>";
echo"</select>";
}
So I think this will put all selected values into an array.
But the problem is that when user submits the form this array goes to $_POST
array
And I have no idea how to read a value from an array $data which is into
array $_POST and use it as a part of "if" statement
for example
if (value_from_array==5){
// instructions
}
Thanks for help
Leszek
[Back to original message]
|