Location: PHPKode > scripts > classListbox > classlistbox/example.php
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>ListBox example</title>
<style type="text/css">
<!--
.style1 {
	font-family: Verdana, Arial, Helvetica, sans-serif;
	font-size: 10px;
}
-->
</style>
</head>

<body>
<form id="form1" name="form1" method="post" action="">
  <p>
    <?
  include ("classListbox.php");
	mysql_connect("localhost","root","");
	mysql_select_db("mydatabase");
	echo "My Catalogs:";
	$oListBox= new classListBox("mycatalogs");
	$oListBox->set_query("select catalog,rowid from catalog","rowid");
	$oListBox->set_postback(true);
	$oListBox->display();
	
	echo "<br/>Products";
	$oListBox2= new classListBox("myproducts");
	$oListBox2->set_query("select product,productid from inventory where catalogid='".$oListBox->get_selectedItemKey()."'","productid");
	$oListBox2->display();
?></p>
  <p align="center" class="style1">Carlos Miguel Guevara Diaz del Castillo<br />
    <a href="mailto:hide@address.com">hide@address.com</a> </p>
</form>
</body>
</html>
Return current item: classListbox