<?php
$res = mysql_query("SELECT * FROM users WHERE username = '$user' LIMIT 1");
if(mysql_num_rows($res)>0){
$d = mysql_fetch_array($res)){
if($pass == $d['password']){
session_regenerate_id(); //security for changing permissions
$_SESSION['user_id'] = $d['user_id'];
$_SESSION['usertype_id'] = $d['usertype_id'];
switch($d['usertype_id']){
case 1:
$loc = "nurse.php";
break;
case 2:
$loc = "paramedic.php";
break;
case 3:
$loc = "doctor.php";
break;
case 4:
$loc = "medprac.php";
break;
case 5:
$loc = "wardboss.php";
break;
case 6:
$loc = "consultant.php";
break;
}
header("Location: $loc");
}
}
}
?>
sparkles_links
0
Newbie Poster
Recommended Answers
Jump to PostWhat is the problem ?
Jump to PostYou had an exstra ) on line 3
long live 'TAB'
<?php $res = mysql_query("SELECT * FROM users WHERE username = '$user' LIMIT 1"); if(mysql_num_rows($res)>0) { $d = mysql_fetch_array($res); if($pass == $d['password']) { session_regenerate_id(); //security for changing permissions $_SESSION['user_id'] = $d['user_id']; $_SESSION['usertype_id'] = $d['usertype_id']; switch($d['usertype_id']) { …
All 7 Replies
pritaeas
2,194
¯\_(ツ)_/¯
Moderator
Featured Poster
sparkles_links
0
Newbie Poster
pritaeas
2,194
¯\_(ツ)_/¯
Moderator
Featured Poster
sparkles_links
0
Newbie Poster
pzuurveen
90
Posting Whiz in Training
sparkles_links
0
Newbie Poster
pritaeas
2,194
¯\_(ツ)_/¯
Moderator
Featured Poster
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.