Login   Register  
PHP Classes
elePHPant
Icontem

File: fClassHTML/example/inputForm/index2.php

Recommend this page to a friend!
Stumble It! Stumble It! Bookmark in del.icio.us Bookmark in del.icio.us
  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: 6 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'3030),
                        
'Cognome:', array('text''cognome'2020),
                        
'Indirizzo:', array('text''indirizzo'4050),
                        
'CAP:', array('text''cap'55),
                        
'Cittą:', array('text''citta'3030),
                        
'Prov.:', array('text''prov'22),
                        );
        
$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';
?>