In this session, we are going to create a very simple login page in php, username and password entered in login page we will get posted in another page.
Now we will see how to create a simple Login page in WAMP Server
1) Create a folder name sampleloginwithoutdatabase in c:/xampp/htdocs/sample as shown below.
2) We are going create two file in the above folder, one is a login page in html and other one is getdata page in php.
Code for Login page in html
<title>SIMPLE LOGIN FORM IN PHP WITHOUT DATABASE</title>
<form action = "getdata.php" method = "POST">
USER NAME <input type = "text" name = "username"> <br><br>
PASSWORD <input type = "text" name = "password"> <br><br>
<input type = "Submit" name = "insert" value = "Save">
<input type = "Reset" value = "Cancel">
3) The following code help us to transfer username and password entered in the login page to other page
<head> <title>get data from LOGIN page</title>
echo "username:" .$_POST["username"]."</br>";
The following will be the output of the above simple login page we created in PHP
After clicking the save button username and password entered in our login page, we will see it in next page as shown below