Post method

How the variables are passed in post method? Internally how it works?

How does the manual say it works?

not mentioned clearly

What are you having a hard time understanding? Is there a particular issue I can try and help you with?

Internally the super global variable named $_POST is created, which is an array and it has all the elements of the form submitted via post method. I think, being an array, it is passed by value in php just like arrays are passed. Being super global means you can access $_POST in any script, on any part of your script, and you don’t have to actually pass $_POST var yourself, just access it anywhere you need it.

Thanks lampcms

To add, form elements with a name attribute gets passed, not all. So names are automatically used as the keys in $_POST, and element values are the value in the array.

Post a form to a script containing,


<?php
echo '<pre>'; print_r($_POST); echo '</pre>';
?>

This will implode (separate) the array into it’s individual pieces.
This is a good visualization of $_POST.