Login   Register  
PHP Classes
elePHPant
Icontem

File: example.php

Recommend this page to a friend!
Stumble It! Stumble It! Bookmark in del.icio.us Bookmark in del.icio.us
  Classes of Max V. Moiseenko  >  form_handler  >  example.php  >  Download  
File: example.php
Role: ???
Content type: text/plain
Description: simple example
Class: form_handler
Author: By
Last change:
Date: 2001-08-15 12:08
Size: 1,983 bytes
 

Contents

Class file image Download
<?
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("you@mail.adress","Example");
  echo $m->answer;
}
?>