04.01.2017, 12:10
How to change this to sha1? this with Whirpool wp_hash i want change it to sha1.
can help? i already try, but dont work
can help? i already try, but dont work
PHP код:
<?php
session_start();
include "koneksi.php";
if(isset($_SESSION['playername']))
{
go('index.php', 'You already logged in.');
}
if(!isset($_POST['username'], $_POST['password']))
{
go('index.php', 'Please fillout all required forms.');
}
else
{
$query = $koneksi->prepare("SELECT `adminlevel`,`name` from `players` where `name` = ? and `pass` = ?");
$query->execute(array($_POST['username'], strtoupper(hash("whirlpool", $_POST['password']))));
if($query->rowCount() > 0)
{
$data = $query->fetch();
go('index.php', 'Succesfully logged in.');
$_SESSION['playername'] = $data['name'];
$_SESSION['playerlevel'] = $data['adminlevel'];
}
else
{
go('index.php', 'Wrong username or password.');
}
}