0

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

here is my code:

<?php

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: ./processing.php");
                    exit;

                    }

                    else
                        echo "INTERNET BANKING ACCESS IS CURRENTLY RESTRICTED, PLEASE CALL YOUR ACCOUNT OFFICER FOR ACTIVATION!. $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";

Edited by office1111

2
Contributors
2
Replies
19
Views
3 Years
Discussion Span
Last Post by office1111
0

you can do so using .htaccess with url rewriting if on apache.
on IIS yo have to prepare iirf.ini for the similar reason.
A typical rewrite rule in .htaccess file would look like this -

RewriteRule ^index.php?username=(.*)$  account_$1/welcome.php 

Edited by network18: used code tags

0

how do i do this please if you can demonstrate i will appreciate it

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.