I'm attempting to build a login page for my website. I have managed to create a database with a simple username and password column. And have used Dreamweaver in order to create the login form. My problem is that I want users to be redirected to different pages based off of who they are. Example: if Bob (username: bob123) logs in I want him to be redirected to page x, but if Joe (username: joe123) logs in I want him to be redirected to page y. Dreamweaver only lets me specify one page.

Does anyone know any code that would redirect users based off their username in a database.

My HTML and CSS skills are decent, but I know almost nothing when it comes to this sort of thing. Any help would be greatly appreciated.

Thanks!

Here is the php code that I have so far (it was made by Dreamweaver, not me).

<?php

// *** Validate request to login to this site.

if (!isset($_SESSION)) {

session_start();

}

$loginFormAction = $_SERVER['PHP_SELF'];

if (isset($_GET['accesscheck'])) {

$_SESSION['PrevUrl'] = $_GET['accesscheck'];

}

if (isset($_POST['username'])) {

$loginUsername=$_POST['username'];

$password=$_POST['password'];

$MM_fldUserAuthorization = "";

$MM_redirectLoginSuccess = "http://------------";

$MM_redirectLoginFailed = "http://-------------";

$MM_redirecttoReferrer = false;

mysql_select_db($database_-------------, $---------);

$LoginRS__query=sprintf("SELECT Username, Password FROM userdatabase WHERE Username=%s AND Password=%s",

Well, I don't use DreamWeaver (I do have it installed on my box since it came with CS5 Web Premium... never once fired it up), but my suggestion would be to store each user's preferred login page in your database, get the value from the database, and change $MM_redirectLoginSuccess accordingly.

This will require some knowledge of PHP and MySQL. No time like the present to learn :P