PHP Classes

File: array_example.php

Recommend this page to a friend!
  Packages of Arturo Di Lecce   Fast HTML form creator and validator   array_example.php   Download  
File: array_example.php
Role: Example script
Content type: text/plain
Description: array example of the class usage
Class: Fast HTML form creator and validator
Generate and validate Web forms
Author: By
Last change: added captcha support
Date: 19 years ago
Size: 1,271 bytes
 

 

Contents

Class file image Download
<?php
session_start();
  // Form Properties
  include("fast_form.class.php");
  $o = new fast_form();
  $o->action_validate = "array_example.php"; //where is form validation , in this case is in this page
  $o->action_validated = "validated.php"; //whhat it includes if validation goes well
  $o->method="POST"; //form method
  $o->name="example"; //form name

  //fields array
  $o->input = array(
  array(
  'type'=>'text',
  'label'=>'nome',
  'name'=>'nome',
  'value'=>$_POST['nome'],
  'id'=>'',
  'class'=>'',
  'required'=>1,
  'style'=>'',
  'javascript'=>'',
  'select_option'=>'',
  'var_type'=>'string',

  ),
  array(
  'type'=>'text',
  'label'=>'cognome',
  'name'=>'cognome',
  'value'=>$_POST['cognome'],
  'id'=>'',
  'class'=>'',
  'required'=>1,
  'style'=>'',
  'javascript'=>'',
  'select_option'=>'',
  'var_type'=>'string',

  ),
  array(
  'type'=>'text',
  'label'=>'inserire il codice sottostante:',
  'name'=>'captcha',
  'required'=>1
  ),
  array('type'=>'submit',                        //THIS IS THE SUBMIT BUTTON CONFIGURATION
  'label'=>'',
  'name'=>'invia',
  'value'=>'invia',
  'id'=>'',
  'class'=>'',
  'required'=>0,
  'style'=>'',
  'javascript'=>''));

  $o->make();
?>