Some Mysql / php questions

BeauJangles

Lifer
Aug 26, 2001
13,941
1
0
Hey guys,

I come mostly from a Java / C background in programming (although I haven't been actively doing any of that for at least two years now). I've come to the realization that the website I'm working on would be ideal for a MYSQL database to store the data.

Basically, i want a small news section (updated by hand now), a forum (which is already taken care of by phpbb), a calender where events can be posted, a roster and alumni page, the ability to sort players alphabetically and by their graduation year, and a login prompt to prevent some people from accessing this data (I would like guests to be able to see user-specified informaton, but not everything). This also (obviously) is going to require an administrator account and a lot of other stuff.

I've been reading up on basic PHP / MYSQL stuff and it really doesnt' seem that complicated in terms of syntax and coding. I think the part I might need some help with is the theory on how to do all of this. For instance, how do I specify certain users as administrators? Things like that.

If anybody has any advice for me, or websites to start visiting that would be great.

And I also know this is a large project, but I really want to do this and I'm perfectly willing to just throw myself in and see what happens.

Thanks,

Beau
 

Barnaby W. Füi

Elite Member
Aug 14, 2001
12,343
0
0
Looking at code from similar projects always helps.

If you just want two levels of users (normal and admin), then you could simply have a boolean 'admin' flag in your 'users' table. If you want more complex permissions then you might want to implement an ACL (access control list) system.

One example of ACLs in web software is moin: http://moinmoin.wikiwikiweb.de/HelpOnAccessControlLists (although it's written in python and is a wiki, not a cms)
 

Chebago

Senior member
Apr 10, 2004
575
0
0
marcyes.com
how I handled access privileges on my sight was to give different levels, this allows me access to all the customization options of the site, while giving others access only to things like uploading pictures, etc.. The easiest way to do this is to check for a value before you load the page, if the value isn't present then you can set the variable to a default value. So when I enter a page, it checks the value associated with my account, if it matches the supposed ADMIN value, then everything is opened up. If it doesn't have a value then it defaults to the "all users" value which restricts access to certain parts of the page. To help you out, you'll probably want to study up on sessions in php. If you want a more indepth discussion on how this works or I didn't explain myself, just pm me, I would be happy to give you any help.
 

oog

Golden Member
Feb 14, 2002
1,721
0
0
another possibility is to just have a different set of administrative pages (or known user pages) that are controlled through something like .htaccess and .htpasswd (if your hosting provider is using apache).

tell us when you get around to taking a pass at a data model for the data you want to store.