متغیرهای از پیش تعریف شده
PHP Manual

$_POST

$HTTP_POST_VARS [نامطلوب]

$_POST -- $HTTP_POST_VARS [نامطلوب]متغیرهای POST در HTTP

Description

یک آرایه شرکت‌پذیر داده شده به اسکریپت فعلی از طریق متد POST در HTTP.

$HTTP_POST_VARS همان اطلاعات اولیه را در خود دارد اما یک superglobal نیست. (توجه کنید $HTTP_POST_VARS و $_POST متغیرهای متفاوتی هستند و PHP نیز با آنها بدین گونه رفتار خواهد کرد)

Changelog

Version Description
4.1.0 معرفی $_POST موجب نامطلوب بودن $HTTP_POST_VARS شد.

Examples

Example #1 نمونه $_POST

<?php
echo 'Hello ' htmlspecialchars($_POST["name"]) . '!';
?>

فرض اینکه کاربر name=Hannes را از طریق POST ارسال کرده است.

The above example will output something similar to:

Hello Hannes!

Notes

Note:

This is a 'superglobal', or automatic global, variable. This simply means that it is available in all scopes throughout a script. There is no need to do global $variable; to access it within functions or methods.

See Also


متغیرهای از پیش تعریف شده
PHP Manual