Jump to content
Larry Ullman's Book Forums

Search the Community

Showing results for tags 'e-commerce2nd edition login'.



More search options

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • Single Editions
    • Modern Javascript: Develop and Design
    • The Yii Book
    • Effortless Flex 4 Development
    • Building a Web Site with Ajax: Visual QuickProject
    • Ruby: Visual QuickStart Guide
    • C++ Programming: Visual QuickStart Guide
    • C Programming: Visual QuickStart Guide
    • Adobe AIR: Visual QuickPro Guide
  • PHP and MySQL for Dynamic Web Sites: Visual QuickPro Guide
    • PHP and MySQL for Dynamic Web Sites: Visual QuickPro Guide (5th Edition)
    • PHP and MySQL for Dynamic Web Sites: Visual QuickPro Guide (4th Edition)
    • PHP 6 and MySQL 5 for Dynamic Web Sites: Visual QuickPro Guide (3rd Edition)
    • PHP and MySQL for Dynamic Web Sites: Visual QuickPro Guide (2nd Edition)
    • PHP and MySQL for Dynamic Web Sites: Visual QuickPro Guide (1st Edition)
  • PHP for the Web: Visual QuickStart Guide
    • PHP for the Web: Visual QuickStart Guide (5th Edition)
    • PHP for the Web: Visual QuickStart Guide (4th Edition)
    • PHP for the Web: Visual QuickStart Guide (3rd Edition)
    • PHP for the World Wide Web: Visual QuickStart Guide (2nd Edition)
    • PHP for the World Wide Web: Visual QuickStart Guide (1st Edition)
  • Effortless E-commerce with PHP and MySQL
    • Effortless E-Commerce with PHP and MySQL (2nd Edition)
    • Effortless E-Commerce with PHP and MySQL
  • PHP Advanced: Visual QuickPro Guide
    • PHP Advanced and Object-Oriented Programming: Visual QuickPro Guide (3rd Edition)
    • PHP 5 Advanced: Visual QuickPro Guide (2nd Edition)
    • PHP Advanced: Visual QuickPro Guide
  • MySQL: Visual QuickStart Guide
    • MySQL: Visual QuickStart Guide (2nd Edition)
    • MySQL: Visual QuickStart Guide (1st Edition)
  • Other
    • Announcements
    • Newsletter, Blog, and Other Topics
    • Forum Issues
    • Social

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


Found 1 result

  1. Hello Larry, E-com 2 edition is more developed and therefore more interesting than 1. I have a connection problem with the login. Registration and works well in the database. But if I want to log, I get an error as if the password db could not be read. Can you give me a track for research. Thank you in advance Congratulations for your work see my file, so it looks like yours. The message is "The email address and password1" so it's the password problem <?php $login_errors = array(); //validation if(filter_var($_POST['email'], FILTER_VALIDATE_EMAIL)){ $e = escape_data($_POST['email'], $dbc); }else{ $login_errors['email'] = 'SVP, email valide'; } if(!empty($_POST['pass'])){ $p = $_POST['pass']; }else{ $login_errors['pass'] = 'SVP, password valide'; } if(empty($login_errors)){ // Query the database: $q = "SELECT id, username, type, pass, IF(date_expires >= NOW(), true, false) AS expired FROM users WHERE email='$e'"; $r = mysqli_query($dbc, $q); if (mysqli_num_rows($r) === 1) { // A match was made. // Get the data: $row = mysqli_fetch_array($r, MYSQLI_ASSOC); // Validate the password: include('./is/lib/password.php'); if(password_verify($p,$row['pass'])) { // Correct! // If the user is an administrator, create a new session ID to be safe: // This code is created at the end of Chapter 4: if ($row['type'] === 'admin') { session_regenerate_id(true); $_SESSION['user_admin'] = true; } // Store the data in a session: $_SESSION['user_id'] = $row['id']; $_SESSION['username'] = $row['username']; // Only indicate if the user's account is not expired: //if ($row['expired'] == true) $_SESSION['user_not_expired'] = true; if ($row['expired'] ===1) $_SESSION['user_not_expired'] = true; } else { // Right email address, invalid password. $login_errors['login'] = 'The email address and password1.'; } } else { // No match was made. (technically, only the email address failed) $login_errors['login'] = 'The email address and password do not match those on file2.'; } } // End of $login_errors IF.
×
×
  • Create New...