Results 1 to 9 of 9

Thread: Day 18 - Login Page - Become PHP Expert in 30 days

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #4
    Join Date
    Nov 2009
    Posts
    76,596

    Default

    I got it Password Matched

    http://php.flashwebhost.com/sherly/login.html


    Code:
    <?php
    
    require 'includes/database.php';
    
    $email = $_POST['email'];
    $password = $_POST['password'];
    
    $email = trim($email);
    $password = trim($password);
    
    $sql = "select * from users where email='$email'";
    
    $result = $mysqli->query($sql);
    
    if ($result->num_rows == 0) {
        die("No user with email address $email found");
    }
    
    $userInfo = mysqli_fetch_assoc($result);
    
    if ($userInfo['password'] == $password) {
        echo "Password Matched";
    } else {
        die("Invalid password");
    } 
    
    echo 'Password Matched;
    Last edited by sherlyk; 08-04-2014 at 05:14 PM.

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •