Get data From Html Form using PHP

Google Advertisements

Connect PHP Code with DataBase PHP Create Database MySQL

How to Get data From Html Form using PHP

For get data from from Html form you need $_POST function. First create one variable and pass filename in $_POST[] as a argument.


$variable_name = $_POST["field_name"];


<form action="" method="post">
Username: <input type="text" name="username" placeholder="username"><br>
Password: <input type="password" name="password" placeholder="password"><br>
<button type="submit" value="submit">Submit</button>

Using above Html page you can fill your data in textfile, this is html file after doing this process we create new php file and get Html form data on php page using $_POST function and store this data in $name and $pass variable. because on Html page we are using post method so use $_POST function. At last print value on web page using echo " ";

Get Html textfield data using PHP

$name = $_POST["username"];
$pass = $_POST["password"];

echo $name."</br>";
echo $pass."</br>";




Live Demo


Your Outpur After Running code

Connect PHP Code with DataBase PHP Create Database MySQL

Google Advertisements

We have more than 5 Groups which have 500000+ Members and some Pages have more than 100000+ members. For Advertisement contact on or 9999595223

Buy This Ad Space @$50 per Month, Ad Size 600X200 Contact on: or 8076671483

Pure VPN Privide Lowest Price VPN Just @ $1.65. Per Month with Non Detected IP Lowest Price Non Detected IP VPN

Classpath variable is set for providing a path for predefined Java classes which is used in our application. All classes are available in lib/rt.jar so we set classpath upto lib/rt.jar. Difference between path and classpath in Java

Cloud computing is the on demand availability of computer system resources, especially data storage and computing power, without direct active management by the user. Cloud Computing Tutorial

College Projects Related to Java, AWT, C Projects for College, C++ Projects for College, Android Projects. Download Java C C++ Projects

Download Projects

Adsense Advertisements

Buy This ads Space 8076671483

Buy This Ad Space @$120 per Month, Ad Size 300X600 Contact on: or 8076671483 Try this Keyword C++ Programs