Essentials of $_POST
When you fill out a form on the internet, especially registration forms, the data you are supplying is sent to the server using one of two methods – POST or GET. The method used depends on the sensitivity of the data. Most registration forms use the POST method. If they dont, then the site is terribly insecure.
$_POST is a PHP method that has one job – to take the info you entered into a form and make it available to the server you are sending to. It does so by storing that data in an array. The index of the array is the form fields and the corresponding value of each index is the data you entered. So for a registration form like one below
The $_POST array would look like so:
username->rambo; password->123shoot; email->rambo@hurtin.com;
You can access the values using the following syntax:
$username=$_POST['username'];
Leave a comment