YYYYAAAAAAYYYYYYYYY!!!!!!!!!!!
DONE IT!!!!!!!!!!!! 🙂 🙂 🙂
gee wizz what a ride ... hehehehehe
main site;
site.com.index.html
login page;
site.com/login/login.php
users pages
site.com/users/user1.php | user2.php.................
login page
<?php
session_start();
$message = "Please Log in.";
if(!empty($_POST['username']) and !empty($_POST['password'])){
$username = $_POST['username'];
$password = $_POST['password'];
if(($username == "user1") and ($password == "pass1") or
($username == "user2") and ($password == "pass2") or
($username == "user3") and ($password == "pass3") or
($username == "user4") and ($password == "pass4") or
($username == "user5") and ($password == "pass5") or
($username == "user6") and ($password == "pass6") or
($username == "user7") and ($password == "pass7")){
$_SESSION['user'] = $username;
header("Location: /users/{$username}.php");
die;
}else{
$message = "Your username and or password are incorrect.";
}
}
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<title>Login</title>
</head>
<body>
<h1><?php echo($message); ?></h1>
<form action="<?php echo(basename(htmlentities($_SERVER['PHP_SELF']))); ?>" method="post" accept-charset="utf-8">
<p>Username:<input type="text" name="username" /></p>
<p>Password:<input type="password" name="password" /></p>
<p><input type="submit" value="Login →" /></p>
</form>
</body>
</html>
change "user1" to "your clients name" ... "user2" "user3" etc
change "pass1" to "your clients password" ... "pass2" "pass3" etc
user page
<?php
session_start();
$page = basename(htmlentities($_SERVER['PHP_SELF']));
$page = explode(".", $page);
if(empty($_SESSION['user']) or ($page['0'] != $_SESSION['user'])){
header("Location: /");
die;
}
?>
the users html page content goes here
add this to each user page
and thats it ... its a wrap
multi-client log-in to personal "private" pages within your site
ehehehehehe
thanks to all
sophia 🙂