Home How to make a safe login?
Reply: 0

How to make a safe login?

user913
1#
user913 Published in April 22, 2018, 5:58 pm

I tried some safe login methods, but it always failed to make a safe login code. Can somebody help me ? Here is my code:

<?php

if (isset($_POST["submit"])){


    $con=mysqli_connect("127.0.0.1", "root", "", "pedicureadmin");
    if (mysqli_connect_errno($con))
    {
        echo "MySql Error: " . mysqli_connect_error();
        }

    $query=mysqli_query($con,"SELECT * FROM inloggen WHERE Username='$_POST[username]' && Password='$_POST[password]'");
    $count=mysqli_num_rows($query);
    $row=mysqli_fetch_array($query);

    if ($count==1)
    {
        session_start();
        $_SESSION['username'] = $_POST['username'];
        $_SESSION['password'] = $_POST['password'];
        header("location: prijzenveranderen.php");
        }
    else
    {
        echo "Invalid username or password";
        }   

    mysqli_close($con);
    }
    ?>
You need to login account before you can post.

About| Privacy statement| Terms of Service| Advertising| Contact us| Help| Sitemap|
Processed in 0.304187 second(s) , Gzip On .

© 2016 Powered by mzan.com design MATCHINFO