User is logged in, but i need to limit access to specific files based on a mysql_query that gets the group_id of the user, then checks that against it's alowwed group_id's.
If the group_id matches, PHP renders the page, if it's another value, echo's an error message "you need to be in group n to see this".
I plan to bury this in each index file in each group's folder, what's the syntax of the php/mysql for this?
<?
//auth the user if not logged in
//get the user's group_id
//pass the group_id to a function
//function decides if it's ok to render the page