PHP Classes

File: Example.php

Recommend this page to a friend!
  Classes of patric   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: 12 years ago
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');

     }