PHP Classes

File: fClassHTML/example/inputForm/index2.php

Recommend this page to a friend!
  Classes of Dario Mazzeo   fClassHTML   fClassHTML/example/inputForm/index2.php   Download  
File: fClassHTML/example/inputForm/index2.php
Role: Example script
Content type: text/plain
Description: Esempio di Form generico con classe
Class: fClassHTML
Display composite Web page elements
Author: By
Last change:
Date: 16 years ago
Size: 1,215 bytes
 

Contents

Class file image Download
<?php

include (realpath(dirname(__FILE__).'../../../../sClassHTML/sClassHTML.php'));
include (
realpath(dirname(__FILE__).'../../../fClassHTML.php'));

class
myFormUtente extends inputForm {

    public function
__construct($page='index2.php'){
       
parent::__construct($page);
       
$campi = array( 'Nome:', array('text', 'nome', 30, 30),
                       
'Cognome:', array('text', 'cognome', 20, 20),
                       
'Indirizzo:', array('text', 'indirizzo', 40, 50),
                       
'CAP:', array('text', 'cap', 5, 5),
                       
'Cittą:', array('text', 'citta', 30, 30),
                       
'Prov.:', array('text', 'prov', 2, 2),
                        );
       
$bottoni = array('submit', array('submit', 'Invia'),
                        
'reset', array('cancella', 'Cancella')
                        );
       
$this->addFields($campi);
       
$this->addButtons($bottoni);
    }
}

// creazione pagina
$mypage = new sHtml("Benvenuto");

// aggiunta Css alla pagina
$mypage->addCss('../../css/inputForm.css');

// creazione form
$form = new myFormUtente();

// aggiunta del form alla pagina
$mypage->addObj($form);

// stampa della pagina
echo $mypage;

// verifica dei dati
if ($_POST['nome']=='dario' && $_POST['cognome']=='mazzeo')
    echo
'Verifica dati.';
else
    echo
'Verifica non riuscita';
?>