Note : Need php code for this, not the pseudo code but actual working code
Add a login system to protect part of your project web site, e.g. administrator pages, or user's personal information page.
It should contain the following 3 pages:
1) login page - has form asking user for username and password
2) response page - checks username and password against arrays of valid usernames and passwords (normally this is done against a database - we'll change it later)
If valid - saves username to cookie, and sets session variable LoggedIn to TRUE. If not, sets the session variable to FALSE.
Displays link to "content page" (the page you're protecting).
3) content page - checks session variable - if user is LoggedIn (session variable is true), says Hello "XXXX" where XXXX is the username from the cookie.
If not logged in, displays error message and link back to login page. (If you want, you can have it redirect automatically after a certain number of seconds using a meta refresh tag.)
Note : Need php code for this, not the pseudo code but actual working code Add a login system to protect part of your pr
-
- Site Admin
- Posts: 899603
- Joined: Mon Aug 02, 2021 8:13 am