Home Tutorial Php List PHP list box

 
 

Share on Google+Share on Google+
PHP list box
Posted on: October 31, 2009 at 12:00 AM
Advertisement
In this part of the tutorial we will learn how to use the list box in the PHP form.And we will also see the example related to the list box.
  • The PHP List box is used in the form.
  • It takes input values from the user.
  • The PHP List box contains multiple values at a time.

PHP List Box Example

<?php
    
if(isset($_GET['hobbie']))
       echo
"My hobbie is ".$_GET['hobbie'];
     else
{?>

     Select your hobbie <form action='<?php echo $_SERVER['PHP_SELF'];?>'>
     <
select name='hobbie' size="4">
     <
option value='music'>music</option>
     <
option value='reading'>reading</option>
     <
option value='swimming'>swimming</option>
     </
select>
     <
input type="submit">
     </
form>
<?php
}?>

 

output

My hobbie is music
Advertisement

Related Tags for PHP list box:


Follow us on Twitter, or add us on Facebook or Google Plus to keep you updated with the recent trends of Java and other open source platforms.

Posted on: October 31, 2009

Recommend the tutorial

Advertisements Advertisements
 

 

 

DMCA.com