<?php
//to use this class try this
$_GET = array('array1'=>array('1','2','text'),'array2'=>array('qwerty','qwerty','qwerty'),'array3'=>'<qwerty>');
$gpc = new Request();
$gpc->setshield(FALSE);
$gpc->setmode('INT');
$gpc->define(array('array1','array2','array2'),'ARR','G');
print_r($gpc->array1);
$gpc->setmode('TXT');
$gpc->define('array2','ARR','G',4);
print_r($gpc->array2);
$gpc->define('array3','SLU','G');
$gpc->globalize();
print_r($array3);
//you can write some exeption class to know what kind of error and where occured
/**/
// if you try
$_GET = array('q'=>'w\'e');
$gpc->define('q','HTM','G');
print_r($gpc->q);
/*
you will have [w'e] its not mistake becouse you should use mysql_escape_string() or something like this but not in this class but in class managing data base
*/
$oldname = '897231612.343';
$gpc->validate('newname','NUM',$oldname);
$gpc->globalize('newname');
print_r($newname);
$print_r($gpc->getnames());
$gpc->undefine('newname','q');
$print_r($gpc->getnames());
//or use 'getall' to define all $_REQUEST variables
$gpc->getall();
?>
|