Make Urtutorials.com your homepage | Add to Favorites      


Simple Login  

Simple password script
This tutorial will show you how to protect your file
**THIS ISN'T SAFE WE RECOMMEND USING SESSIONS, Look for the tutorial soon**

Code:
<form method="post" action="check.php">
<input type="password" name="password">
<input type="submit" value="Log On">
</form>

<?
config password
if ($_POST['password'] == "MY PASSWORD") {
include ("proceed.php"); //this is where you will go
}
else {
//Error message if password is wrong
echo "Error wrong password provided!";
}
?>

 

This first bit is just a simple HTML form.

The second bit checks if the password provided is correct, if not it echo a ERROR message if its correct then it will proceed on to proceed.php
.
 
Discuss this tutorial in the Forum.

Other good stuff:-


Submited by:- Farooq Azam

Discussions Forum Login:-

Username:
Password:  

Remember Me    
Not a member?
Register here

Copyright © UrTutorials.com - All rights ® reserved A Publispain Group Website