How to hash this
#1

How do I hash this script (login Script)
PHP код:
<?php
// checkLogin.php
session_start(); // Start a new session
require('conn.php'); // Holds all of our database connection information
// Get the data passed from the form
$username $_POST['user'];
$password $_POST['password'];
// Do some basic sanitizing
$username stripslashes($username);
$password stripslashes($password);
$sql "select * from players where user = '$username' and pass = '$password'";
$result mysql_query($sql) or die ( mysql_error() );
$count 0;
while (
$line mysql_fetch_assoc($result)) {
     
$count++;
}
if (
$count == 1) {
     
$_SESSION['loggedIn'] = "true";
     
header("Location: loginSuccess.php"); // This is wherever you want to redirect the user to
} else {
     
$_SESSION['loggedIn'] = "false";
     
header("Location: loginFailed.php"); // Wherever you want the user to go when they fail the login
}
?>
Reply


Messages In This Thread
How to hash this - by Mriss - 30.05.2014, 07:38
Re: How to hash this - by RajatPawar - 30.05.2014, 08:23
Re: How to hash this - by Mauzen - 30.05.2014, 08:44
Re: How to hash this - by Mriss - 30.05.2014, 10:29
Re: How to hash this - by Kaperstone - 30.05.2014, 13:56
Re: How to hash this - by Mauzen - 30.05.2014, 14:30
Re: How to hash this - by brent94 - 30.05.2014, 16:39
Re: How to hash this - by brent94 - 30.05.2014, 17:02
Re: How to hash this - by Mauzen - 30.05.2014, 18:24
Re: How to hash this - by Kaperstone - 30.05.2014, 18:45

Forum Jump:


Users browsing this thread: 1 Guest(s)