Home

GETPOST

GETPOST is a term used in web development to refer to a small input handling utility that retrieves parameters from HTTP requests. It is designed to provide a single, unified way to access data sent to a web application via either the GET query string or the POST request body, with the goal of simplifying input handling and promoting consistent validation.

In typical implementations, GETPOST accepts the name of a request parameter and may also support optional defaults

History and usage contexts: The concept originated in early PHP-based CMS and framework code as a convenience

Security and design considerations: While GETPOST can simplify code and reduce boilerplate, it can obscure whether

See also: GET, POST, REQUEST, input filtering, superglobals.

or
filtering.
A
common
behavior
is
to
return
the
value
from
POST
if
present,
otherwise
from
GET,
and
to
fall
back
to
a
specified
default
when
the
parameter
is
absent.
Some
variants
also
offer
an
optional
type
or
filter
argument
to
apply
basic
sanitization
or
type
conversion
as
part
of
retrieval.
wrapper
around
the
superglobals
$_GET
and
$_POST
(and
sometimes
$_REQUEST).
It
was
notably
associated
with
certain
content
management
systems,
where
module
and
form
developers
relied
on
a
consistent
helper
to
read
user
input.
Over
time,
many
modern
frameworks
have
shifted
toward
explicit
access
via
dedicated
request
objects
and
dedicated
filtering
utilities,
reducing
reliance
on
implicit
GETPOST-style
helpers.
data
originated
from
a
URL
or
a
form
submission.
This
has
implications
for
idempotence,
caching,
and
security.
Developers
are
advised
to
validate
and
sanitize
all
input,
be
mindful
of
the
data
source,
and
follow
framework-specific
recommendations
for
request
handling.