Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Warning: mysqli_fetch_array() expects parameter 1 to be mysqli_result, boolean given in /storage/ssd1/425/3721425/public_html/login.php on line 22
- <?php
- session_start();
- error_reporting(E_ALL);
- ini_set('display_errors', 1);
- include_once('module/config.php');
- if(isset($_SESSION['id'])){
- header("location: index.php");
- }
- if(isset($_POST['login'])){
- $identification = $_POST['username'];
- $identification = mysqli_real_escape_string($link, $identification);
- $password = $_POST['password'];
- $password = mysqli_real_escape_string($link, $password);
- if($identification == "" || $password == "")
- {
- echo "Error Username / Password Wrong !";
- }else {
- $sql ="SELECT * FROM usrr WHERE usrname='$identification' LIMIT 1";
- $query = mysqli_query($link, $sql);
- $row = mysqli_fetch_array($query);
- $id= $row['uid'];
- $db_pss =$row['usrpass'];
- if (password_verify($password, $db_pss)){
- $_SESSION['id'] = $id;
- $_SESSION['name'] = $row['name'];
- header("location: index.php");
- }else{
- echo "Error Username / Password Wrong !";
- }
- }
- }
- ?>
- <form method="post">
- <label>username : </label>
- <input type="text" name="username"><br/>
- <label>password : </label>
- <input type="password" name="password"><br/>
- <input type="submit" name="login" value="login">
- </form>
Add Comment
Please, Sign In to add comment