Results 1 to 9 of 9

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

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Nov 2004
    Location
    India
    Posts
    65

    Default

    http://php.flashwebhost.com/stefin/login.php

    Password Matched.


    PHP 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"); 
    }
    Last edited by stefin; 08-05-2014 at 11:13 AM.

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
  •