Documentation

http
in package

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

Tags
author

Stefan Seehafer aka imagine fanpress@nobody-knows.org

copyright

(c) 2011-2020, Stefan Seehafer

deprecated

FPCM 4.4, use new request/ response handler instead

see
request
see
response

Table of Contents

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

Constants

FILTER_BASE64DECODE

HTTP Filter base64_decode

public mixed FILTER_BASE64DECODE = 12
Tags
since
4

FILTER_CASTINT

HTTP Filter intval

public mixed FILTER_CASTINT = 9
Tags
since
3.5.2

FILTER_DECRYPT

HTTP Filter crypt::decrypt

public mixed FILTER_DECRYPT = 10
Tags
since
3.5.2

FILTER_FIRSTUPPER

HTTP Filter ucfirst

public mixed FILTER_FIRSTUPPER = 13
Tags
since
4

FILTER_HTMLENTITIES

HTTP Filter htmlentities

public mixed FILTER_HTMLENTITIES = 3
Tags
since
3.5.2

FILTER_HTMLENTITY_DECODE

HTTP Filter html_entity_decode

public mixed FILTER_HTMLENTITY_DECODE = 6
Tags
since
3.5.2

FILTER_HTMLSPECIALCHARS

HTTP Filter htmlspecialchars

public mixed FILTER_HTMLSPECIALCHARS = 2
Tags
since
3.5.2

FILTER_HTMLSPECIALCHARS_DECODE

HTTP Filter htmlspecialchars_decode

public mixed FILTER_HTMLSPECIALCHARS_DECODE = 5
Tags
since
3.5.2

FILTER_JSON_DECODE

HTTP Filter json_decode

public mixed FILTER_JSON_DECODE = 8
Tags
since
3.5.2

FILTER_REGEX

Regex filter

public mixed FILTER_REGEX = 14
Tags
since
4.3

FILTER_REGEX_REPLACE

Regex replace filter

public mixed FILTER_REGEX_REPLACE = 15
Tags
since
4.3

FILTER_STRIPSLASHES

HTTP Filter stripslashes

public mixed FILTER_STRIPSLASHES = 4
Tags
since
3.5.2

FILTER_STRIPTAGS

HTTP Filter strip_tags

public mixed FILTER_STRIPTAGS = 1
Tags
since
3.5.2

FILTER_TRIM

HTTP Filter trim

public mixed FILTER_TRIM = 7
Tags
since
3.5.2

FILTER_URLDECODE

HTTP Filter urldecode

public mixed FILTER_URLDECODE = 11
Tags
since
3.5.2

Properties

$request

HTTP-Reuqest aus $_REQUEST und $_COOKIE

private static array<string|int, mixed> $request

Methods

cookieOnly()

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

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

Variablenname

$filter : array<string|int, mixed> = [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

filter()

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

public static filter(string $filterString, array<string|int, mixed> $filters) : mixed
Parameters
$filterString : string
$filters : array<string|int, mixed>

@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

get()

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

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

Variablenname

$filter : array<string|int, mixed> = [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

getFiles()

Gibt Inhalt von Dateiupload via PHP zurück

public static getFiles() : array<string|int, mixed>
Tags
deprecated

FPCM 4.4

Return values
array<string|int, mixed>

getHttpHost()

Gibt HTTP-Host des aktuellen Nutzers zurück

public static getHttpHost() : string
Tags
deprecated

FPCM 4.4

Return values
string

getIp()

Gibt IP-Adresse des aktuellen Nutzers zurück

public static getIp() : string
Tags
deprecated

FPCM 4.4

Return values
string

getOnly()

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

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

Variablenname

$filter : array<string|int, mixed> = [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

getSessionVar()

Ließt Daten aus $_SESSION

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

FPCM 4.4

Return values
mixed

false, wenn Variable nicht gesetzt

init()

HTTP initialisieren

public static init() : mixed
Return values
mixed

postOnly()

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

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

Variablenname

$filter : array<string|int, mixed> = [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

setSessionVar()

Schreibt Daten in $_SESSION

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

FPCM 4.4

Return values
mixed

Search results