Monday, October 6, 2014

2.3 $_POST

The Code

- Ok guys, this is the code inside of controller.php using the global variabe $_POST. Just like the previous $_GET tutorial. We used the $_POST variable in order for us to retrieved/catch data of the form having POST. Now lets observe the output.

The Output

- This is the output of the form having POST method. As you noticed there's no much more difference in terms of displaying data in the browser. However, we can notice some difference when we talked about the url encoding. So let move on..

The URL Encoding

- In this part, I want you to observe on how it encodes the data using the $_POST variable. You can always go back to the previous tutorial if you need to. As you can see there is no  reference data and value as well as "?" and "&" symbol which connecting each data. However, it still output the result on the browser. Hence, try to click on the url then when everything is highlighted already. please press the enter key on your keyboard and you can see the result will be gone and and it will display some errors.

The Conclusion

- Similarly the $_POST variable displays the data as $_GET variable does however it does not display the data in the browser permanently.