01.08.2017, 01:49
Html y css manejo re piola, pero en php hace mucho que no lo toco y me pierdo jajaja, me ayudas con йste cуdigo y usar Whirlpool tambiйn (como el de la gm)?
Mirб, el que usa la GM es algo asн
Mientras que el de la PCU es algo asн
Si podrнas ayudarme te lo agradecerнa mucho jajaja, saludos!
Mirб, el que usa la GM es algo asн
Код:
stock udb_hash(buf[]) // by: DracoBlue { new length=strlen(buf); new s1 = 1; new s2 = 0; new n; for (n=0; n<length; n++) { s1 = (s1 + buf[n]) % 65521; s2 = (s2 + s1) % 65521; } return (s2 << 16) + s1; }
PHP код:
<?php
if(Config::init()->isLogged()) header('Location: ' . Config::$_PAGE_URL . '');
if(isset($_POST['f_submit'])) {
$q = Config::$g_con->prepare("SELECT * FROM `accounts` WHERE `Username` = ? AND `Password` = ? LIMIT 0,1");
$q->execute(array($_POST['f_name'],hash('whirlpool',$_POST['f_password'])));
if($q->rowCount() != 0) {
$row = $q->fetch();
$_SESSION['user'] = $row['Username'];
header('Location: ' . Config::$_PAGE_URL . '');
} else echo '<center><font color="red">Nombre de usuario o contraseсa incorrecta.</font>';
}