Welcome to Designers Dairy blog here i have posted How to create a Simple Php Login page
without Database
Step 1: Create Login .html and save
<form action='logins.php' method='post'>
Username : <input type='text' name='username'> <br/>
Password : <input type='password' name='pass'> <br/>
<input type='submit' value='Login'>
</form>
Step 2: Create Login .php and save
without Database
Step 1: Create Login .html and save
Login.html
<form action='logins.php' method='post'>
Username : <input type='text' name='username'> <br/>
Password : <input type='password' name='pass'> <br/>
<input type='submit' value='Login'>
</form>
Step 2: Create Login .php and save
Login.php
<form action='login.php' method='post'>
Username : <input type='text' name='username'> <br/>
Password : <input type='password' name='pass'> <br/>
<input type='submit' value='Login'>
</form>
<?php
$username = $_POST['username'];
$password = $_POST['pass'];
if($username == 'admin')
Username : <input type='text' name='username'> <br/>
Password : <input type='password' name='pass'> <br/>
<input type='submit' value='Login'>
</form>
<?php
$username = $_POST['username'];
$password = $_POST['pass'];
if($username == 'admin')
{
echo "Login Successfull";
header('Location: booked.html');
}
else
echo "Login Successfull";
header('Location: booked.html');
}
else
{
echo "Username and Password does not Match";
}
?>
echo "Username and Password does not Match";
}
?>
Step3 : Have A fun.............!
No comments:
Post a Comment