04.01.2017, 02:06
how to connect with website pcp if i wanna login?
example with whirlpool, use wp_hash
example with whirlpool, use wp_hash
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.');
}
}