I'm about to start an assignment and am just trying to think of the most logical waysd of doing things at the moment. The assignment involves using mysql and php to create a website for a training company.

The part i am having trouble conceptualizing is this:

"Tutors are created by administrator(s) after the credentials of the tutor has been checked. To become a course tutor the individual will register as a tutor."

So what I need is to be able to have someone register as a tutor but not be able to access the site until his account has been confirmed by an administrator.

I was going to have a page where the administrator could add and delete records and also edit the contents of fields.

What i'm thinking is having a field in my database called TYPE which would store either "tutor" "validatedtutor" or "student" and then having a line of code on restricted pages something along the lines of

if type = "tutor"
{
You are still waiting validation from a moderator.
} 

if type = "validatedtutor"
{
continue with correct page
} 

if type = "student"
{
continue with correct page}

Obviously, this is loost psudo code but does anybody think it will work. Thanks in advance to anyone who can help.

Recommended Answers

All 2 Replies

Why not just insert the new user record into the database when they request the account, but have a field called "confirmed" or "verified" which initially is set to 0 (zero). When the admin confirms the account, simply make it a 1 (one). Then all you have to do is:

/// Assuming that $user is an object that contains the record from the user table:
if ($user->confirmed1)
{
    // grant them full access
}
else
{
    // don't grant them access as they have yet to be confirmed!
}

You could also have a field for "role" to differentiate between tutors and students. Are you going to require any sort of confirmation of the student accounts, whether it be by an admin or through them clicking a link in an email?

sorry for the delay but i managed to fix it in the end. Thanks a lot for your help though

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.