urgent please hurry up(simple question)i wnat values of item selected in listbox(<select name=yahoo type=list multiple>) after submnitting form
if i use count($yahoo) or sizeof($yahoo) if giving incorrect values
why it is happening.
Printable View
urgent please hurry up(simple question)i wnat values of item selected in listbox(<select name=yahoo type=list multiple>) after submnitting form
if i use count($yahoo) or sizeof($yahoo) if giving incorrect values
why it is happening.
Here's an example:
Code:<?php
if (isset($_POST['submit'])) {
for ($i = 0; $i < count($_POST['yahoo']); $i++) {
echo $_POST['yahoo'][$i] . "<br>\n";
}
} else {
echo '<form action="test.php" method="post">
<select name="yahoo[]" type="list" multiple>
<option value="one">One</option>
<option value="two">Two</option>
<option value="three">Three</option>
</select><br>
<input type="submit" name="submit" value=" Submit ">
</form>';
}
?>