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 Jaroslaw Krainski  >  My validation class  >  Example.php  >  Download  
File: Example.php
Role: Example script
Content type: text/plain
Description: example
Class: My validation class
Validate input values with validator classes
Author: By
Last change:
Date: 2012-09-04 11:39
Size: 980 bytes
 

Contents

Class file image Download

    $request = $this->getRequest();
    
    $validate = new Validate;
    $validators = new Validators;
    
    $validate->setForm($validators->get('register'));

    $validate->addValidators();
    
    $validate->doValidate($request->post('imie'), 'imie');
    $validate->doValidate($request->post('nazwisko'), 'nazwisko');
    $validate->doValidate($request->post('email'), 'e_mail');
    $validate->doValidate($request->post('telkontaktowy'), 'telkontaktowy');
    $validate->doValidate($request->post('pesel'), 'pesel');
    $validate->doValidate($request->post('dowod'), 'dowod');
    $validate->doValidate($request->post('adreszam'), 'adreszam');   
    $validate->doValidate($request->post('adreskor'), 'adreskor');  
    $validate->doValidate($request->post('regulamin'), 'regulamin');  
  
    if(isset($_SESSION['errors'])){
      
    $this->redirect('/register');
      
      
      } else {


   $this->redirect('/proceed');

     }