vadymka Posted July 20, 2013 Share Posted July 20, 2013 (edited) 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 Edited July 20, 2013 by vadymka Quote Link to comment 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. Quote Link to comment Share on other sites More sharing options...
vadymka Posted July 20, 2013 Author Share Posted July 20, 2013 (edited) 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.. Edited July 20, 2013 by vadymka Quote Link to comment 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 } Quote Link to comment 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? Quote Link to comment Share on other sites More sharing options...
vadymka Posted July 20, 2013 Author Share Posted July 20, 2013 (edited) REMOVED Edited July 20, 2013 by vadymka Quote Link to comment Share on other sites More sharing options...
vadymka Posted July 20, 2013 Author Share Posted July 20, 2013 (edited) wtf? i used edit and it created a new post.. delete it please.. Edited July 20, 2013 by vadymka Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.