Small login form using PHP

Today I learnt to small form using PHP .

I studied some concept of $_GET , $_POST , $_REQUEST method

and done a small problem with that example 🙂

This is HTML form . which will send request to form.php


<title>Submit your form</title>
<form action = "form.php" method = "post">
Name : <input type = "text" name = "uname"></br></br>
Password : <input type = "password" name = "password" ></br></br>
<input type = "submit" value = "button">


$user =  $_REQUEST['uname'];
$pass =   $_REQUEST['password'];
//echo $pass;

if ($user == "sathia" && $pass == "sathia") {
echo "<h1><font color = 'red'>Welcome ".$user."</font></h1>";
echo "Hello admin";
else {
 echo "<h1><font color = 'red'>You are Guest!!</font></h1>";
 echo "<p>welcome ,you are guest please register</p>";



About sathia

Web developer at cloudmint
This entry was posted in Web. Bookmark the permalink.

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s