Welcome Guest, Not a member yet? Register   Sign In
What the best way to.....
#1

[eluser]the_unforgiven[/eluser]
Hi Guys,

I'm wanting to know what is the best way to do the following:

IF i have an admin area where i can login into the admin panel to do whatever but then if i have a user section on the frontend how can i get it so that it show all differeent sessions so if im logged in as a user it says hi, username for user panel and same for if logged into admin panel?
#2

[eluser]Jan_1[/eluser]
different names?!
#3

[eluser]skunkbad[/eluser]
Set a cookie that indicates that the user is logged in, and put their first and last name there too, as a convenience for use in the application.
#4

[eluser]the_unforgiven[/eluser]
Yes diffferent names i have a users table sin the db and admins but when i login as a user i can login into admin and done want that to happen.

Set a cookie how would i acheive that?
#5

[eluser]limit[/eluser]

If your already using sessions: When a user logs in, you can just make a function to pull the username from the user table and then store it in the session.

(eg: select username from users where user_id = $user_id

Why your able to login to both admin and the user side depends on how you setup your database and code. There is not enough info to help you with that.
#6

[eluser]the_unforgiven[/eluser]
Yes i have made two functions to pull admins in one function then users in another but i can still login has a user into the admin area, which i shouldn;t be allowed to do.




Theme © iAndrew 2016 - Forum software by © MyBB