How can I first show the syntax for logging into the system when I type a folder name in localhost
P粉3511384622024-04-02 14:32:52
0
2
391
Don’t know what the syntax is? What I want to happen is that when I type localhost/farm-e-mart the first file should show the login system. How can I do this?
If the user is not logged in, check the cookie/session and redirect to the login page.
If login is not mandatory but you want to ensure the user sees the login page, create a session that is started in the login page. And check if the session exists on other pages and then redirect
If the user is not logged in, check the cookie/session and redirect to the login page.
If login is not mandatory but you want to ensure the user sees the login page, create a session that is started in the login page. And check if the session exists on other pages and then redirect
First, if your web application allows user authentication, do so.
On a page you don't want unauthenticated users to access, add this code to the top of your code script, for example profile.php
Then, add this code snippet on the login page.