PHP Classes

File: example.php

Recommend this page to a friend!
  Classes of Carlos Miguel Guevara   classListbox   example.php   Download  
File: example.php
Role: Example script
Content type: text/plain
Description: example
Class: classListbox
Generate form select inputs from database queries
Author: By
Last change:
Date: 18 years ago
Size: 1,224 bytes
 

Contents

Class file image Download
<!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:dejitaru@gmail.com">dejitaru@gmail.com</a> </p>
</form>
</body>
</html>