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).
Expand|Select|Wrap|Line Numbers
- 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.