vadymka Posted July 20, 2013 Share Posted July 20, 2013 Hi.. How can i create admin user? i Added a table named "admin" i want it to be.. if its 0 user is a simple member.. if its 1 user have admin. if user have admin... he will have a link "CP" that will go to the control panel..members cant see the link. [even if simple member have the link he dont have acces to it] And, if user have admin.. a link will apear near the chat.. "Clear Chat" that clears the chat messages..[i have a chat] Can someone help me with this?? Thanks Link to comment https://forums.phpfreaks.com/topic/280343-admin-user/ Share on other sites More sharing options...
trq Posted July 20, 2013 Share Posted July 20, 2013 Where exactly are you stuck? This is pretty simple checking for specific conditions. Link to comment https://forums.phpfreaks.com/topic/280343-admin-user/#findComment-1441486 Share on other sites More sharing options...
vadymka Posted July 20, 2013 Author Share Posted July 20, 2013 Where exactly are you stuck? This is pretty simple checking for specific conditions. I have no idea how to do this I watched tutorials.. but they show how to build a entire website with admin user.. but i already have a website.. i dont know how to import the admin user.. Link to comment https://forums.phpfreaks.com/topic/280343-admin-user/#findComment-1441487 Share on other sites More sharing options...
trq Posted July 20, 2013 Share Posted July 20, 2013 It's pretty simple logic. When you log your users in, save their 'status' in the $_SESSION array. Then, just check that to see if they are an admin or not. if (isset($_SESSION['status']) && $_SESSION['status'] == 1) { // you have an admin } else { // you have a normal user } Link to comment https://forums.phpfreaks.com/topic/280343-admin-user/#findComment-1441488 Share on other sites More sharing options...
vadymka Posted July 20, 2013 Author Share Posted July 20, 2013 It's pretty simple logic. When you log your users in, save their 'status' in the $_SESSION array. Then, just check that to see if they are an admin or not. if (isset($_SESSION['status']) && $_SESSION['status'] == 1) { // you have an admin } else { // you have a normal user } I made it.. i used <?php if($CURUSER["status"]=='Admin'){code here} ?> can you now help me with http://forums.phpfreaks.com/topic/280344-how-to-update-phpmyadmin/ please? Link to comment https://forums.phpfreaks.com/topic/280343-admin-user/#findComment-1441489 Share on other sites More sharing options...
vadymka Posted July 20, 2013 Author Share Posted July 20, 2013 REMOVED Link to comment https://forums.phpfreaks.com/topic/280343-admin-user/#findComment-1441494 Share on other sites More sharing options...
vadymka Posted July 20, 2013 Author Share Posted July 20, 2013 wtf? i used edit and it created a new post.. delete it please.. Link to comment https://forums.phpfreaks.com/topic/280343-admin-user/#findComment-1441495 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.