Location: PHPKode > scripts > form_handler > form_handler/example.php
<?
include("form_handler.php");

$m=new form_handler('en');

/*********************************************************************************************************************/
$m->url="example.php";
$m->add_title("Ïðèìåð","Example");

$m->add_file('img',"Çàãðóçèòü êàðòèíêó <br>(ôîðìàò gif,jpg,png; <br>ðàçìåð &lt; 20k):","Image upload<br>(format gif,jpg,png; <br>size &lt; 20k):","gif|jpeg|jpg|jpe|png");

$m->add_field('f1',"Ïðèìåð ïîëÿ 'text':","Example of field 'text'","","",'text',false);
$m->add_field('f2',"Ïðèìåð ïîëÿ 'text':","Example of field 'text'","îáÿçàòåëüíîå","obligatory",'text',true);
$m->add_field('f3',"Ïðèìåð ïîëÿ 'textarea':","Example of field 'textarea':","","",'textarea');

$tmp=array(
  "s1"=>array('ru'=>"îöèÿ 1", 'en'=>"option 1", 'selected'=>false),
  "s2"=>array('ru'=>"îïöèÿ 2", 'en'=>"option 2", 'selected'=>true),
  "s3"=>array('ru'=>"îïöèÿ 3", 'en'=>"option 3", 'selected'=>true),
  "s4"=>array('ru'=>"îïöèÿ 4", 'en'=>"option 4", 'selected'=>false),
  "s5"=>array('ru'=>"îïöèÿ 5", 'en'=>"option 5", 'selected'=>false)
);
$m->add_select('f4',"Ïðèìåð ïîëÿ 'select' 1:","Example of field 'select': 1",$tmp);
$m->add_select('f5',"Ïðèìåð ïîëÿ 'select': 2","Example of field 'select': 2",$tmp,false,4,true);

$tmp=array(
  "s1"=>array('ru'=>"îöèÿ 1", 'en'=>"option 1", 'selected'=>true),
  "s2"=>array('ru'=>"îïöèÿ 2", 'en'=>"option 2", 'selected'=>false)
);
$m->add_radio('f6',"Ïðèìåð ïîëÿ 'radio':","Example of field 'radio':", $tmp);
$m->add_checkbox('f7',"Ïðèìåð ïîëÿ 'checkbox':","Example of field 'checkbox':", "", 'checkbox', false, true);

$m->add_comment("<center>**** êîìåíòàðèé ****", "<center>**** comment ****");
/*********************************************************************************************************************/



if( !isset($GLOBALS["ok"]) ){
  echo $m->print_form();
}else{
  $m->make_html_table();
  $m->send_form("hide@address.com","Example");
  echo $m->answer;
}
?>
Return current item: form_handler