multimember access
Posted: Fri Nov 17, 2006 2:43 pm
I currently have a login form on my website, but I need to have each member go to different sections of my site. What would be the easiest way to accomplish this while still being secure. I am not using .htaccess but php. I can successfully get them to the member page but need to redirerct them base on the user name. the ext is the extension saved in MySQL that I need to forward them to. any suggestions? Heres the member.php
Code: Select all
<?
require('main.php');
session_start();
if (!isset($_SESSION['uid'])) {
$_SESSION['uid'] = $_REQUEST['uid'];
$_SESSION['pwd'] = $_REQUEST['pwd'];
}
$uid = $_SESSION['uid'];
$pwd = $_SESSION['pwd'];
db_connect();
$res = mysql_query("SELECT * FROM users WHERE uid='$uid' AND pwd='$pwd' and status='active'");
$re = mysql_fetch_array($res);
if(mysql_num_rows($res) != 0) {
echo "<br><b>Logging Into Your Account - - -</b>";
} else {
include(INC_DIR."header.php");
unset($_SESSION['uid']);
unset($_SESSION['pwd']);
echo "<br><b>Login Failed</b> Try Again!";
include(INC_DIR."login.php");
}
$result = mysql_query("SELECT * FROM users WHERE uid='$uid' AND pwd='$pwd'");
while($row = mysql_fetch_array($result))
{
echo $row['ext'];
}
db_disconnect();
?>