You are here: Re: login script with two levels of access « PHP Programming Language « IT news, forums, messages
Re: login script with two levels of access

Posted by SterLo on 05/31/07 14:31

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 } ?>

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация