PHP List Box Post


 

PHP List Box Post

In this part of the tutorial we will learn how to create list box. Example also shows how to retrieve the list box value in php code.

In this part of the tutorial we will learn how to create list box. Example also shows how to retrieve the list box value in php code.

  • The PHP Post List box is used in the form. It contains multiple value
  • User can select one or more values from the PHP list Box
  • This PHP Post List Box is the alternate of Combo box


PHP Post List Box Example

<?php
    if(isset($_POST['country']))
    echo "I belongs to country ".$_POST['country'];
      else {?>

    Select your country <form action='<?php echo $_SERVER['PHP_SELF'];?>' method="post">
    <
select name='country' size="4">
      <
option value='UK'>UK</option>
      <
option value='Canada'>Canada</option>
      <
option value='USA'>USA</option>
      <
option value='India'>India</option>
    </
select>
    <
input type="submit">
    </
form>
<?php
}?>

Ads