Jump to content

victor zain

  • Content Count

  • Joined

  • Last visited

Community Reputation

0 Neutral

About victor zain

  • Rank
  1. victor zain

    login function

    @justsomeguy kindly give me an example of how it should be please. Am new to php. Thank you in advance.
  2. victor zain

    login function

    Anyone to help me out please I will appreciate a lot. thank you
  3. victor zain

    login function

    I have a table in database called users to store user details This is the code I have ?php session_start(); if (isset($_POST['submit'])) { include 'dbh.inc.php'; $uid = mysqli_real_escape_string($conn, $_POST['uid']); $pwd = mysqli_real_escape_string($conn, $_POST['pwd']); //Error handlers //check if inputs are empty if (empty($uid) || empty($pwd)) { header("Location: ../index.php?login=empty"); exit(); }else{ $sql = "SELECT * FROM users WHERE user_uid='$uid' OR email ='$uid'"; $result = mysqli_query($conn, $sql); $resultcheck = mysqli_num_rows($result); if ($resultcheck < 1) { header("Location: ../Home.php?login=error"); exit(); }else{ if ($row = mysqli_fetch_assoc($result)) { //De-Hashing the password $hashedpwdCheck = password_verify($pwd, $row['user_pwd']); if ($pwd == false) { header("Location: ../Home.php?login=error"); exit(); }elseif ($pwd == true) { //log in the user into the system $_SESSION['u_id'] = $row['user_id']; $_SESSION['u_First_Name'] = $row['First_Name']; $_SESSION['u_Last_Name'] = $row['Last_Name']; $_SESSION['u_email'] = $row['email']; $_SESSION['u_uid'] = $row['user_uid']; header("Location: ../myAccount/index.php?login=success"); exit(); } } } } }else{ header("Location: ../Home.php?login=error"); exit(); } ?>
  4. victor zain

    login function

    how can I include member login which records invalid login attempts and locks the user out after several attempts like 3 attempts . somebody me please I will appreciate. thank you in advance