Login   Register  
PHP Classes
elePHPant
Icontem

File: config/startup.php

Recommend this page to a friend!
Stumble It! Stumble It! Bookmark in del.icio.us Bookmark in del.icio.us
  Classes of lattuada  >  Another simple MVC  >  config/startup.php  >  Download  
File: config/startup.php
Role: Auxiliary script
Content type: text/plain
Description: definig some autoload and data filtering
Class: Another simple MVC
Model view controller framework implementation
Author: By
Last change:
Date: 4 years ago
Size: 545 bytes
 

Contents

Class file image Download
<?php

//date_default_timezone_set('Europe/Paris');
session_start();

function 
__autoload($class){
    if(
file_exists(APP_DIR "/models/$class.php"))
        require 
APP_DIR "/models/$class.php";
    else
        require 
APP_DIR "/classes/$class.php";
}

function 
filterData($data){
    if(
is_array($data))
        
$data array_map("filterData"$data);
    else        
        
$data htmlentities($dataENT_QUOTES'UTF-8');
    
    return 
$data;
}

$_POST   array_map("filterData"$_POST);
$_GET    array_map("filterData"$_GET);
$_COOKIE array_map("filterData"$_COOKIE);