Login   Register  
PHP Classes
elePHPant
Icontem

File: sample1

Recommend this page to a friend!
Stumble It! Stumble It! Bookmark in del.icio.us Bookmark in del.icio.us
  Classes of Adomas Rimeika  >  Simple HTML form creation  >  sample1  >  Download  
File: sample1
Role: Example script
Content type: text/plain
Description: sample file
Class: Simple HTML form creation
Creation of HTML form
Author: By
Last change:
Date: 2003-10-14 21:08
Size: 807 bytes
 

Contents

Class file image Download
<?PHP
require('cforms.inc');
$form =new crt_forms();

function 
getselected($arr_vars$arr_selected){
    if (
$arr_selected) {
        foreach (
$arr_selected as $val){
            
$arr_vars[$val]['selected'] = 1;    
        }
    }
    return 
$arr_vars
}

$cst_levels = array(
    
=>array('label'=>'level 1'),
    
=>array('label'=>'level 2'),
    
=>array('label'=>'level 3'),
    
=>array('label'=>'level 4'),
    
=>array('label'=>'level 5'),
    
=>array('label'=>'level 6'),
    
=>array('label'=>'level 7'),
    
=>array('label'=>'level 8'),
);


$obj_lev = ($HTTP_POST_VARS['obj_lev']);

echo 
$form->begin_form('','post','','','');
echo 
$form->create_select('obj_lev[]'getselected($cst_levels$obj_lev), 51'Countries''class=cselect');
echo 
$form->create_button('submit''act_new''Save''class=cbutton');
echo 
$form->end_form();


?>