Hi, folks :) Quick question for all you guys and gals with ninja php skills.
I'm setting up a script that will give multiple users access to the current content of a database, update it, archive older items and delete stuff.
Different users will have different privelages. (admin, user)
My question is this: is it better to set up seperate pages for the two groups of users or use the same page and load it differently depending on privledges? One seems like it would require more CPU time, the other more storage space (multiple pages for the two classes of users)...although the effects either way would be fairly minimal?
Also :) is it possible to track the number of users on the system? My thought on that would be to just set up a table calles usersOnline and add to it when users logon and delete when they log off...but what if they just close the browser window without clicking "log out"? is there a way to detect that with php so I could still log them out?
I think thats it...hehe.
Thanks in advance and Merry Christmas!
i'd use the same page and generate based on priveledge..
as for loggin people off, have a script run every few minutes via cron job to check for activity, in your usersOnline table, you could update a timestamp every time they do something.. if no activity is logged for 10 mins, you can take them out of usersOnline or something of that sort
SitePoint Community Advisor
my PHP host: when you want something MORE in a host
Yeah, the one page thing would save a little storage and maybe even some time.
It depends. If you have a lot of space and a a bit more time, try the separate pages.