Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

PHP Forum


You are currently viewing our PHP Forum as a guest. Please register to participate.
Login



Freelance Jobs

Reply
Multi level and multi user login
Old 04-28-2010, 04:04 PM (RESOLVED):Multi level and multi user login
Super Talker

Posts: 128
Name: Jose daSilva
Trades: 0
Hi people
I would like to make a multi level and multi users login with following parameters:
1. status_session=0 user can SEE and CHANGE details of ALL CONTRIES status_session=1,2,3 and 4 users.
2. status_session=1 and a country_session=country user can SEE details of HIMSELF and of ANY COUNTRY, status_session=0,1,2 3 and 4 users, but only can SEE and CHANGE details of SAME countrie’s status_session=2 user.
3. status_session=2 and a country_session=country user can SEE details of HIMSELF and of ANY COUNTRY status_session=0,1,2, 3 and 4 users, but only can SEE and CHANGE details of SAME countrie’s status_session=3 user.
4. status_session=3 and a country_session=country user can SEE details of HIMSELF and of ANY COUNTRY, status_session=0,1,2 3, and 4 users, but only can SEE and CHANGE details of SAME countrie’s status_session=4 user.
5. status_session=4 and a country_session=country user can ONLY SEE details of himself and of ANY COUNRY, status_session=0,1,2,3 and 4 users.
I did the following code but does not work the way I want.
Quote:
<?session_start();
include_once "call_to_DB.inc.php";
if($name == "" or $username == "" or $password ==""){
header("location: index.php?erro=missing name, or username, or password.");
die();
} if ($name !="" and $username !="" and $password !=""){
$sql="select * from inter_agents where status_session='$status_session and name='$name' and username='$username' and password='$password' and INSTR(url, '".$_SERVER['HTTP_HOST']."') limit 1";
$result = mysql_db_query("DB NAME",$sql);
$num_regd=mysql_num_rows($result);
if ($num_regd==1) {
while ($regist=mysql_fetch_array($result)) {
$name=$regist['name'];
$agent_session=$regist['agent_session'];
$country_session=$regist['country'];
$_SESSION["stat_session"] = $regist['status_session'];
$_SESSION["cry_session"] = $country_session;
echo "$num_regd";
}
$admin_session=$id;
$state_session="1";
$name_session=$name;
$agent_session=$agent_session;
$country_session=$country_session;

session_register('admin_session');
session_register('state_session');
session_register('name_session');
session_register('agent_session');
ini_set("session.gc_maxlifetime","5400");
header("location: index2.php");
die();
} else {
$state_session="";
header("location: index.php?erro=Do not found register with your details");
die();
}
} else {
$state_session="";
header("location: index.php?erro=Do not found register with your details");
die();
}?>
Can somebody give me a hand here?
thanks a lot

Last edited by josil; 04-30-2010 at 12:19 PM.. Reason: Wrapping in code tags
josil is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 04-29-2010, 06:27 AM Re: Multi level and multi user login
Extreme Talker

Posts: 181
Name: David Jackson
Trades: 0
wrap your code in code tags please
__________________

Please login or register to view this content. Registration is FREE
davidj is offline
Reply With Quote
View Public Profile
 
Old 04-30-2010, 12:19 PM Re: Multi level and multi user login
Super Talker

Posts: 128
Name: Jose daSilva
Trades: 0
Resolved
josil is offline
Reply With Quote
View Public Profile
 
Reply     « Reply to Multi level and multi user login
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.11962 seconds with 12 queries