PHP.nl

$_POST

$_POST

Form data from HTTP POST requests

An associative array of variables passed to the current script via the HTTP POST method when using or as the HTTP Content-Type in the request. application/x-www-form-urlencoded``multipart/form-data

Voorbeeld: example

<?php
echo 'Hello ' . htmlspecialchars($_POST["name"]) . '!';
?>
 Assuming the user sent a POST request with 
 in the body.
`name=Hannes`
Hello Hannes!

Opmerking: > To read POST data sent with other content types (e.g. or )

must be used. Unlike , which only works with
 and
, 
provides direct access to the raw data from the body of the request.

application/json``application/xmlphp://input$_POST``application/x-www-form-urlencoded``multipart/form-data

Handling external variablesThe filter extension

Documentatie