Hello everybody.
I am quite new to PHP/MYSQL, but have development/design experience since 1997.
I am developing a road race website and need to create the following user options:
-A Team Captain will register and be granted a team captain username/password (populate and initialize tables, however must be access controlled).
-The Team Captain will distribute a username/password to his other possible teammates so they may access the site and register (simplified registration form the populates the teams table)
-The Team Captain will be allowed to view everyone who has signed up only for his team (simple database query i assume).
There are 4 seperate team categories as well.
I have simple forms created, but need assistance with the pathing and database creation.
any advice? Any tools out there that might be of some assistance?
Thanks in advance.
-Michael
Team Captain form/database problem
Moderator: General Moderators
I think you can do this in a single table with columns for:
ID - auto-increment, integer (unique member ID)
access level - tinyint(1): team 1 for team member, 2 for captain, 3 for admin for example
team: text field - or maybe enum
name, pass, email etc
You can use cookies or sessions to authenticate members - cookies might be easier to work with at first.
When you authenticate visitors you could define a bunch of constants for MEMBER_LEVEL, MEMBER_TEAM, MEMBER_NAME etc - or maybe store them as session vars if you're using sessions.
A team captain could get a list of his team members only by querying the table on the value you've set for his team.
Other members or ordinary visitors can be blocked from running captain or admin level scripts with a simple IF (MEMBER_LEVEL > 1) for example.
ID - auto-increment, integer (unique member ID)
access level - tinyint(1): team 1 for team member, 2 for captain, 3 for admin for example
team: text field - or maybe enum
name, pass, email etc
You can use cookies or sessions to authenticate members - cookies might be easier to work with at first.
When you authenticate visitors you could define a bunch of constants for MEMBER_LEVEL, MEMBER_TEAM, MEMBER_NAME etc - or maybe store them as session vars if you're using sessions.
A team captain could get a list of his team members only by querying the table on the value you've set for his team.
Other members or ordinary visitors can be blocked from running captain or admin level scripts with a simple IF (MEMBER_LEVEL > 1) for example.
Right now I have created 3 tables which are being populated:
1) Captains database that is storing all the team captains contact information
2) Team database that is storing all the team billing information
3) Runner database that is storing the individuals info.
What i now need is another way to access control and query with username and passwords. For example, how can I give out a username and password to an individual team member, and allow them to sign on for a specific team only?
-Michael
1) Captains database that is storing all the team captains contact information
2) Team database that is storing all the team billing information
3) Runner database that is storing the individuals info.
What i now need is another way to access control and query with username and passwords. For example, how can I give out a username and password to an individual team member, and allow them to sign on for a specific team only?
-Michael
You'll need a table that relates each team member (captain included) to their respective team. Or, add a column to the existing team member table to hold the id of the team they belong to. So, in either case, you can query when they login to determine which team the belong to and display only that information. 