How to get data from form using $_POST in PHP


Dear All, I would like to share all of you about how to get data from form using $_POST in PHP.
Or you can download full project by click here

1- Create form



Note: action='index.php' mean when you click it will pass your data in input box to index.php file

for "method='post'" mean you pass data by using method post so when you get data in PHP you need get by using $_POST['nameinputform']

method='POST' mean when you submit you data it will not display on url that it different between method='GET' so normally, we use method POST when you don't want user to see data in form on url example: username and password and other...

2-Get Data from form

//get data from form input type
$username = $_POST['username'];
//display data after get it
echo username;


Any question please comment below.thanks
Share on Google Plus

About Unknown

    Blogger Comment
    Facebook Comment

0 comments:

Post a Comment