Page 1 of 1

ADminstration

Posted: Sun Apr 01, 2012 9:12 pm
by prince
how to restrict the users from not allowing to access the admin privilages using php?

Re: ADminstration

Posted: Mon Apr 02, 2012 7:44 am
by egami
Develop userlevel privies within your scripts.

Re: ADminstration

Posted: Mon Apr 02, 2012 8:59 pm
by prince
Thanks egami,

the privilages has been developed but when directly accessing from the url it will be going to admin privilages


ex: if we have an admin privilage like Remove.php is the option for admin . But the user run the same file it will opening for the user also . So how restrict the user from redirecting..

Re: ADminstration

Posted: Wed Apr 04, 2012 4:12 am
by egami
if ($_SESSION['userlevel'] < 100) {
die("You do not have access to this page.");
}

Re: ADminstration

Posted: Thu Apr 05, 2012 2:16 am
by prince
Thanks egami,

i have tried that one also .it is working in the localhost but it is not working in the live site.

Re: ADminstration

Posted: Thu Apr 05, 2012 12:31 pm
by egami
make sure that session_start() is at the beginning of your script.

Re: ADminstration

Posted: Mon Apr 09, 2012 9:47 pm
by prince
Thank you

the script has been kept before starting of the page
i given userlevel=1,adminlevel=5, though also using user level accessing the admin pages
by chagnging the url..