Hi,
hope this is in the right topic...
Running php5 on apache. I've setup a site where people can login as "demo", "demo" and play around with the functions of the site. Part of the functionality involves uploading files, deleting/editing using standard form fields and storing data in Mysql.
I want people *not* to be able to delete things, or upload files bigger than 100KB when they're logged in as "demo". I'm wondering if there's a much easier way to accomplish this, than doing what's below with *every* place where data is added/deleted/updated (which is a lot of places).
I was thinking of having a session variable which might restrict these things without having to alter the code on every page. Would that work?
I would appreciate any examples of how I could do this. Thanks.
hope this is in the right topic...
Running php5 on apache. I've setup a site where people can login as "demo", "demo" and play around with the functions of the site. Part of the functionality involves uploading files, deleting/editing using standard form fields and storing data in Mysql.
I want people *not* to be able to delete things, or upload files bigger than 100KB when they're logged in as "demo". I'm wondering if there's a much easier way to accomplish this, than doing what's below with *every* place where data is added/deleted/updated (which is a lot of places).
Code:
if($user=="demo") { echo "Sorry. You cannot delete things in demo mode. Please continue to look around."; } else { // Do whatever normal stuff happens with the data }
I would appreciate any examples of how I could do this. Thanks.
Comment