i want have a multiple user login and redirects them to a specific folder such
as when i have user login of John, and when John logs in it redirects John to
account_john/welcome.php, and another when i have a user called Alex and it
goes to account_alex/welcome.php, is there anyone who can give me a little tips
about that, anybody can help me on this i will appreciate a lot, or how to make
this, i will gladly i appreciate it thanks
here is my code:
<?php
if($username && $userid) {
echo "<h1>You are already logged in <a
href='accounts_john/welcome.php'>Click Here</a> To go back your account</h1>";
}
else{
$form = "<form action='./login.php' method='post'>
<table>
<tr>
<td>Username:</td> <td><input type='text' name='user' /></td>
</tr>
</table>
<table>
<tr>
<td>Password:</td> <td><input type='password' name='password' /></td>
</tr>
</table>
<input type='submit' name='loginbtn' value='Login' />
</form>";
if ($_POST['loginbtn']) {
$user = $_POST['user'];
$password = $_POST['password'];
if ($user) {
if ($password) {
require("connect.php");
$password = md5(md5("agdagsjagsj".$password."77gggg77g7g7g"));
$query = mysql_query("SELECT * FROM users WHERE username='$user'");
$numrows = mysql_num_rows($query);
if($numrows == 1) {
$row = mysql_fetch_assoc($query);
$dbid = $row['id'];
$dbuser = $row['username'];
$dbpass = $row['password'];
$dbactive = $row['active'];
if ($password == $dbpass) {
if($dbactive == 1) {
$_SESSION['userid'] = $dbid;
$_SESSION['username'] = $dbuser;
header("Location: accounts_john/processing.php");
exit;
}
else
echo "Your Account is not Active. $form";
}
else
echo "Your Password is incorrect. $form";
}
else
echo "Your Username is not listed in our database. $form";
mysql_close();
}
else
echo "You enter no password. $form";
}
else
echo "Please enter your username. $form";
}
else
echo $form;
}
?>
and of course i know that md5 is not pretty much secured but i want to use it
as a beginner