| 
<? require 'form_generator.class'; ?>
<!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" xml:lang="en" lang="en">
 <head>
 <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
 <title>XHTML/CSS Form Generator Basic Example</title>
 <link type="text/css" rel="stylesheet" href="form.css" media="screen" />
 <style type="text/css">
 /* We use CSS in order to change the apperance of our fields by referrencing thier ID */
 form textarea#comments { width: 25em; height: 8em; }
 form input#submit { width: auto; }
 </style>
 </head>
 
 <body>
 <?
 // Form Properties
 $o = new form_generator();
 $o->name = "add_user";
 $o->method = "post";
 $o->action = $_SERVER['REQUEST_URI'];
 // Form Fields
 $o->input = array(
 array(
 'type'=>'text',
 'label'=>'Name',
 'name'=>'name',
 'value'=>$_POST['name'],
 'id'=>'name'
 ),
 array(
 'type'=>'password',
 'label'=>'Password',
 'name'=>'password',
 'value'=>'',
 'id'=>'password'
 ),
 array(
 'type'=>'select',
 'label'=>'State',
 'name'=>'state',
 'options' => array('OH'=>'Ohio','CA'=>'California','FL'=>'Florida'),
 'id'=>'state'
 ),
 array(
 'type'=>'textarea',
 'label'=>'Comments',
 'name'=>'comments',
 'value'=>'this is an assload of text that should show up in the textare as the current value',
 'id'=>'comments'
 ),
 array(
 'type'=>'submit',
 'label'=>'',
 'name'=>'Submit',
 'value'=>'Submit',
 'id'=>'Submit'
 )
 );
 
 $o->make();
 ?>
 </body>
 
 </html>
 |