Jump to content

Admin User


vadymka

Recommended Posts

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 by vadymka
Link to comment
Share on other sites

Where exactly are you stuck? This is pretty simple checking for specific conditions.

 

I have no idea how to do this :D

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 by vadymka
Link to comment
Share on other sites

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
Share on other sites

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
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.