Link to home
Start Free TrialLog in
Avatar of dgarofalo
dgarofaloFlag for United States of America

asked on

How do I fix the error preventing users from logging in?

I have a set of files that came with a book that I am reading. I am not able to login using the files. I have
the correct name for the username, password, server, and database name. After a successful login, the
user should be redirected to the members-page.php. Here is the url for the site.

https://www.domgarofalo.com/mptc/152-118/lp3/login.php

The practice username is johndoe@email.com and the password is 12345678. Also, I have attached
the files with the database file included. I added the following three lines to display the errors on
the page and no errors appear are an unsuccessful login.

ini_set('display_errors', 1);
ini_set('display_startup_errors', 1);
error_reporting(E_ALL);

Can someone point me in the right direction? Thank you.

Archive.zip
ASKER CERTIFIED SOLUTION
Avatar of Chris Stanyon
Chris Stanyon
Flag of United Kingdom of Great Britain and Northern Ireland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Hi.

The PHP error will only display PHP errors and will not display validation error, let say the email does not exists or password is not ok, for those errors you need to do PHP (server side validation)

You can check the PHP log file for errors (usually in cpanel, plesk or sometimes directly into the script directory)
Make sure DB connection is ok and PHP version is corresponding to the one mentionned in the tutorial.

For security reason do not display "Between 8 and 12 characters" on your login form /registration form
(you can display a message that this not meet the pw requirement)

I'm using this script it is well written, secure and this is very good to learn PHP, OOP and Ajax.
https://codecanyon.net/item/advanced-security-php-registerlogin-system/5282621
Avatar of dgarofalo

ASKER

Thank you both for the help!