If you have the page you wish to redirect to stored in the database then all you have to do is query it at the same time you query the Username and Password
Can do something like this...
$sql = "select username, page from users where username = '" . $username . " and password = password('" . $password . "')";
Where $username and $password are submitted from the form, they can probably be also accessed via $_POST[] too.
Anyways, then all you need to do is check that some recoreds had been returned...
$rs = mysql_query($sql) or die(mysql_error());
if (mysql_num_rows($rs) != 0) {
$data = mysql_fetch_array($rs);
header("location: " . $data["page"]);
}
This should then redirect the user to the page stored in the db.
Now one thing to know about the header() is that no data can be sent to the browser prior to calling this function... even if you have somehting like this
<?php ?>
<?php ?>
the blank linke between the php calls will be sent to the browser and you will get an error...
Hope this helps
PHPdev