Skip to content

Instantly share code, notes, and snippets.

View nielsmh's full-sized avatar

Niels Martin Hansen nielsmh

View GitHub Profile
@nielsmh
nielsmh / login.php
Last active January 12, 2017 18:02 — forked from InukVT/login.php
$username = $_POST['username'];
$password = $_POST['password'];
$username = stripslashes($username);
$username = mysqli_real_escape_string($db, $username);
$sql = "SELECT * FROM users WHERE username='$username'";
$res = mysqli_query($db, $sql) or die(mysqli_error($db));
if (mysqli_num_rows($res) > 0)
{
$row = mysqli_fetch_assoc($res);
$hash = $row['password'];