PHPBuilder - *Simple* Login



RSS Twitter
Snippets Other

*Simple* Login

by: Brandon
|
September 26, 2004

Version: 1.0

Type: Full Script

Category: Other

License: GNU General Public License

Description: A Very Simple, No-SQL User login. It is two pages. How to add more users is included. There is no protection so make a folder with a funky name or something but this is good if you want an admin.php and login from there then click to goto a secret area or something. Ill make a cookie one later.



<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">

<html>
<head>
<title>Untitled</title>
</head>
<body>


<form action="login2.php" method="post">
Username:
<input type="text" name="user">
Password: 
<input type="password" name="password">
<input type="submit" value="Login"></form>


</body>
</html>

----------------------------Cut---------------------------

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">

<html>
<head>
<title>Untitled</title>
</head>
<body>
<?php 
$usern = Tsuji;
$pass = booga;
$usern2 = Bob;
$pass2 = wow;
if ($_POST[$user] = $usern && $_POST[$password] =  $pass) echo("Logged In");
else 
if ($_POST[$user] = $usern2 && $_POST[$password] =  $pass) echo("Logged In");
else
echo("Failed");
?>
</body>
</html>


/*
I am Orangish on the forums so if you need help just PM me.
To remove the second user just delete $usern2 = Bob; and $pass2 = wow;. Also delete 
if ($_POST[$user] = $usern2 && $_POST[$password] =  $pass) echo("Logged In");
else . To add more just keep going with the patterns that are above. Hope you enjoy.

*/

Comment and Contribute

Your comment has been submitted and is pending approval.

Author:
Brandon

Comment:



Comment:

(Maximum characters: 1200). You have characters left.