1234567891011121314151617181920212223242526 |
- <?php
- class Req{
- public static function filt($data, $type = "STRING", $len = -1){
- return Filter::act($data, $type, $len);
- }
- public static function get($field, $type = "STRING", $len = -1){
- if(isset($_GET[$field]))
- return self::filt($_GET[$field], $type, $len);
- return null;
- }
- public static function post($field, $type = "HTML_ESCAPED", $len = -1){
- if(isset($_POST[$field]))
- return self::filt($_POST[$field], $type, $len);
- return null;
- }
- public static function input(){
- if (file_get_contents('php://input')) {
- return self::filt(json_decode(file_get_contents('php://input'), true));
- }
- return null;
- }
- }
|