Php condition sample

Hi there. I’m a newbie here and I can’t find a solution on how to make my php program run. The senario is I have a login form which consist of username & password,the issue is I don’t know how to make a condition to validate if the username matched the password together with the student course registered to that username & password. That if matched, a particular php page will show or will be call specifically for that course of the student.

Im thinking of decalaring of a variable with pre-defined course that will match from the course in the database.

Authenticating who someone is, i.e. logged in, is a separate concern from displaying user specific information.

When the user successfully logs in, you store their user_id (auto-increment primary index) in a session variable. Then, on each page request, you test and use the value in the session variable to control what the user can do or see on the page. A ‘course’ listing page would query for and display any courses the user is registered for, each listing being a link to a details page for that course. The ‘course’ details page would use the session user_id and the requested course id, from the url, to query for and display the specific course information.

Sponsor our Newsletter | Privacy Policy | Terms of Service