Advertisement
hopingsteam

Login php

Sep 28th, 2018
257
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.45 KB | None | 0 0
  1. function user_login() {
  2.     $login_user = "alex";
  3.     $login_pass = "parola";
  4.        
  5.     $query = "SELECT * FROM `users` WHERE (`username`='".$login_user."' OR `email`='".$login_user."') AND `password`='".$login_pass."' LIMIT 1";
  6.     $result = $db_link->query($query);
  7.        
  8.     while ($row=$result->fetch_assoc())
  9.     {
  10.         if (!empty($row))
  11.         {
  12.             //Totul bine
  13.             return true;
  14.         }
  15.     }
  16.     return false;
  17. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement