I'm both new to this forum AND to PHP. I just started learning PHP several weeks ago.
That being said, I have a site that needs to be accessed only by those with a username/password. I have:
>> A MySQL database with full names, usernames and passwords.
>> HTML code that brings the user to a “Welcome” page to log in
>> PHP code that connects to the MySQL database
>> PHP code that checks the database and redirects the user to the “Resources” page (where choices of tasks are available) or rejects the user if credentials are invalid and prompts him to attempt login again.
Having all this, how do I apply it so a folder and sub-folders are accessible only if the login was successful? The way it is now, all I need do is type in the URL for the “Resources” page (bypassing the login at the "Welcome" page) and I’m in. How do I use the login on the “Welcome” page so it applies to the whole folder?
I know that .htaccess and .htpasswd would protect the folder, but I’m in a learning process (no doubt you can see that) and want to know how to do this.
It is for static page, dynamic page, website, SEO, performance and other web development discussion
1 post • Page 1 of 1
Users browsing this forum: No registered users and 1 guest