Login   Register  
PHP Classes
elePHPant
Icontem

File: example

Recommend this page to a friend!
Stumble It! Stumble It! Bookmark in del.icio.us Bookmark in del.icio.us
  Classes of CTAPbIu_MABP  >  mabp::request  >  example  >  Download  
File: example
Role: Example script
Content type: text/plain
Description: examples
Class: mabp::request
Validate HTTP request variable values
Author: By
Last change: examples added
Date: 2006-09-20 06:46
Size: 1,126 bytes
 

Contents

Class file image Download
<?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();

?>