Re: login script with two levels of access
- From: jsd219 <info@xxxxxxxxxxxxxxxxxxxxxx>
- Date: 31 May 2007 09:10:59 -0700
On May 31, 9:31 am, SterLo <sterling.hamil...@xxxxxxxxx> wrote:
Well...
Try this...
It's a little rough but you should get the basic idea.
-------------
<?php
$user1 = "abc";
$user2 = "xyz";
$pass1 = "123";
$pass2 = "456";
$action = (isset($_POST["submit"])) ? $_POST["submit"] :NULL;
if($action == "submit") {
$showForm = false;
$user = $_POST["username"];
$pass = $_POST["password"];
if($user == $user1 && $pass == $pass1) {
/* Include your files here for user1. */
}elseif($user == $user2 && $pass == $pass2) {
/* Include your files here for user2. */
}else{
/* Do error stuff here. */
$showForm = true;
}
}
?>
<?php if($showForm == true) {
<form method="post" action="index.php">
<label for="username">Username:</label>
<input id="username" name="username" type="text" value="" />
<label for="password">Password:</label>
<input id="password" name="password" type="password" value="" />
<input type="submit" name="submit" id="submit" value="Submit" />
</form>
<?php } ?>
Will this not show the user names and passwords in the source code
allowing anyone to pull up the code and get the passwords?
God bless
jason
.
- Follow-Ups:
- Re: login script with two levels of access
- From: Jerry Stuckle
- Re: login script with two levels of access
- References:
- login script with two levels of access
- From: jsd219
- Re: login script with two levels of access
- From: SterLo
- login script with two levels of access
- Prev by Date: Re: OT : filtering the aioe spam
- Next by Date: Re: PHP Setup
- Previous by thread: Re: login script with two levels of access
- Next by thread: Re: login script with two levels of access
- Index(es):
Relevant Pages
|