<select> php generator class
This free php script generates the html code that displays a select menu
like the one shown below. It saves you the time and effort of creating the
code manually and allows you to easily modify the contents of the menu
whenever you want easily.
Here is the generated <select> menu:
And here is the PHP code that generated it:
$myselect = new Select;
$myselect->ListItem = array("First Item", "Second Item", "Third Item", "Fourth Item", "Fifth Item");
$myselect->ListData = array("1", "2", "3", "4", "5");
$myselect->SelectName = "item";
$myselect->SelectedData = 3;
Comments on the above code
You can paste the above code into any PHP script on your server
to generate the <select> menu. You must put the file 'combo.php'
in the same folder as that of your script.
Notice the $myselect->SelectedData
line. You can choose the initial preselected item in the menu by providing its value
in this line. That's why in the above menu 'Third Item' is selected by default.
Values assigned to ListData
can be gathered from a database or a file or
any other dynamic input. Thus you can dynamically change the data in the
is a website
devoted to the open source community. We provide many solutions for
PHP developers. One of our most outstanding programs is
PHP generator for producing
powerful and customizable front-ends for MySQL databases.
Download your free copy now!