Documentation

http

FanPress CM HTTP request class Handler für $_GET, $_POST, $_COOKIE, $_FILES, $_SESSION

Table of Contents

FILTER_STRIPTAGS HTTP Filter strip_tags 1
FILTER_HTMLSPECIALCHARS HTTP Filter htmlspecialchars 2
FILTER_HTMLENTITIES HTTP Filter htmlentities 3
FILTER_STRIPSLASHES HTTP Filter stripslashes 4
FILTER_HTMLSPECIALCHARS_DECODE HTTP Filter htmlspecialchars_decode 5
FILTER_HTMLENTITY_DECODE HTTP Filter html_entity_decode 6
FILTER_TRIM HTTP Filter trim 7
FILTER_JSON_DECODE HTTP Filter json_decode 8
FILTER_CASTINT HTTP Filter intval 9
FILTER_DECRYPT HTTP Filter crypt::decrypt 10
FILTER_URLDECODE HTTP Filter urldecode 11
FILTER_BASE64DECODE HTTP Filter base64_decode 12
FILTER_FIRSTUPPER HTTP Filter ucfirst 13
FILTER_REGEX Regex filter 14
FILTER_REGEX_REPLACE Regex replace filter 15
$request HTTP-Reuqest aus $_REQUEST und $_COOKIE array
init() HTTP initialisieren mixed
get() Daten aus $_REQUEST, $_POST, $_GET, $_COOKIE auslesen Ersetz für direkten Zugriff auf $_REQUEST, $_POST, $_GET, $_COOKIE!!! mixed
postOnly() Daten aus $_POST Ersetz für direkten Zugriff auf $_POST mixed
getOnly() Daten aus $_GET Ersetz für direkten Zugriff auf $_GET mixed
cookieOnly() Daten aus $_COOKIE Ersetz für direkten Zugriff auf $_COOKIE mixed
getIp() Gibt IP-Adresse des aktuellen Nutzers zurück string
getHttpHost() Gibt HTTP-Host des aktuellen Nutzers zurück string
getFiles() Gibt Inhalt von Dateiupload via PHP zurück array
getSessionVar() Ließt Daten aus $_SESSION mixed
setSessionVar() Schreibt Daten in $_SESSION mixed
filter() Führt Filter auf einen String aus, Verwendung v. A. für Werte aus Formularen, etc. mixed

Constants

FILTER_STRIPTAGS

HTTP Filter strip_tags

mixed $FILTER_STRIPTAGS = 1

FILTER_HTMLSPECIALCHARS

HTTP Filter htmlspecialchars

mixed $FILTER_HTMLSPECIALCHARS = 2

FILTER_HTMLENTITIES

HTTP Filter htmlentities

mixed $FILTER_HTMLENTITIES = 3

FILTER_STRIPSLASHES

HTTP Filter stripslashes

mixed $FILTER_STRIPSLASHES = 4

FILTER_HTMLSPECIALCHARS_DECODE

HTTP Filter htmlspecialchars_decode

mixed $FILTER_HTMLSPECIALCHARS_DECODE = 5

FILTER_HTMLENTITY_DECODE

HTTP Filter html_entity_decode

mixed $FILTER_HTMLENTITY_DECODE = 6

FILTER_TRIM

HTTP Filter trim

mixed $FILTER_TRIM = 7

FILTER_JSON_DECODE

HTTP Filter json_decode

mixed $FILTER_JSON_DECODE = 8

FILTER_CASTINT

HTTP Filter intval

mixed $FILTER_CASTINT = 9

FILTER_DECRYPT

HTTP Filter crypt::decrypt

mixed $FILTER_DECRYPT = 10

FILTER_URLDECODE

HTTP Filter urldecode

mixed $FILTER_URLDECODE = 11

FILTER_BASE64DECODE

HTTP Filter base64_decode

mixed $FILTER_BASE64DECODE = 12

FILTER_FIRSTUPPER

HTTP Filter ucfirst

mixed $FILTER_FIRSTUPPER = 13

FILTER_REGEX

Regex filter

mixed $FILTER_REGEX = 14

FILTER_REGEX_REPLACE

Regex replace filter

mixed $FILTER_REGEX_REPLACE = 15

Properties

$request

HTTP-Reuqest aus $_REQUEST und $_COOKIE

private static array $request

Methods

init()

HTTP initialisieren

public static init( ) : mixed
Return values
mixed

get()

Daten aus $_REQUEST, $_POST, $_GET, $_COOKIE auslesen Ersetz für direkten Zugriff auf $_REQUEST, $_POST, $_GET, $_COOKIE!!!

public static get( [ $varname : string = null ] [, $filter : array = [self::FILTER_STRIPTAGS, self::FILTER_STRIPSLASHES, self::FILTER_TRIM] ] ) : mixed
Parameters
$varname : string = null

Variablenname

$filter : array = [self::FILTER_STRIPTAGS, self::FILTER_STRIPSLASHES, self::FILTER_TRIM]

Filter vor Rückgabe durchführen, @see http::filter()

Tags
deprecated

FPCM 4.4

Return values
mixed

null wenn Variable nicht gesetzt

postOnly()

Daten aus $_POST Ersetz für direkten Zugriff auf $_POST

public static postOnly( [ $varname : string = null ] [, $filter : array = [self::FILTER_STRIPTAGS, self::FILTER_STRIPSLASHES, self::FILTER_TRIM] ] ) : mixed
Parameters
$varname : string = null

Variablenname

$filter : array = [self::FILTER_STRIPTAGS, self::FILTER_STRIPSLASHES, self::FILTER_TRIM]

Filter vor Rückgabe durchführen, @see http::filter()

Tags
deprecated

FPCM 4.4

Return values
mixed

null wenn Variable nicht gesetzt

getOnly()

Daten aus $_GET Ersetz für direkten Zugriff auf $_GET

public static getOnly( [ $varname : string = null ] [, $filter : array = [self::FILTER_STRIPTAGS, self::FILTER_STRIPSLASHES, self::FILTER_TRIM] ] ) : mixed
Parameters
$varname : string = null

Variablenname

$filter : array = [self::FILTER_STRIPTAGS, self::FILTER_STRIPSLASHES, self::FILTER_TRIM]

Filter vor Rückgabe durchführen, @see http::filter()

Tags
deprecated

FPCM 4.4

Return values
mixed

null wenn Variable nicht gesetzt

cookieOnly()

Daten aus $_COOKIE Ersetz für direkten Zugriff auf $_COOKIE

public static cookieOnly( [ $varname : string = null ] [, $filter : array = [self::FILTER_STRIPTAGS, self::FILTER_STRIPSLASHES, self::FILTER_TRIM] ] ) : mixed
Parameters
$varname : string = null

Variablenname

$filter : array = [self::FILTER_STRIPTAGS, self::FILTER_STRIPSLASHES, self::FILTER_TRIM]

Filter vor Rückgabe durchführen, @see http::filter()

Tags
deprecated

FPCM 4.4

Return values
mixed

null wenn Variable nicht gesetzt

getIp()

Gibt IP-Adresse des aktuellen Nutzers zurück

public static getIp( ) : string
Tags
deprecated

FPCM 4.4

Return values
string

getHttpHost()

Gibt HTTP-Host des aktuellen Nutzers zurück

public static getHttpHost( ) : string
Tags
deprecated

FPCM 4.4

Return values
string

getFiles()

Gibt Inhalt von Dateiupload via PHP zurück

public static getFiles( ) : array
Tags
deprecated

FPCM 4.4

Return values
array

getSessionVar()

Ließt Daten aus $_SESSION

public static getSessionVar( $varName : string ) : mixed
Parameters
$varName : string
Tags
deprecated

FPCM 4.4

Return values
mixed

false, wenn Variable nicht gesetzt

setSessionVar()

Schreibt Daten in $_SESSION

public static setSessionVar( $varName : string , $value : mixed ) : mixed
Parameters
$varName : string
$value : mixed
Tags
deprecated

FPCM 4.4

Return values
mixed

filter()

Führt Filter auf einen String aus, Verwendung v. A. für Werte aus Formularen, etc.

public static filter( $filterString : string , $filters : array ) : mixed
Parameters
$filterString : string
$filters : array

@see FILTER_* constants

  • allowedtags - erlaubte HTML-Tags für "1 - strip_tags"
  • mode - Modus für
    • "2 - htmlspecialchars"
    • "3 - htmlentities",
    • "5 - htmlspecialchars_decode"
    • "6 - html_entity_decode"
  • object - json_decode-Ergebnis als Objekt oder Array
Tags
deprecated

FPCM 4.4

Return values
mixed

Search results