Newbie to PHP
#1

Hey everybody, i just configured a Panel for my samp server that dosen't had Encryption when you login, i added it succesfuly but my question is: Is safe to do this this way?
After my edit:
Код:
$q = Config::$g_con->prepare('SELECT * FROM `playerinfo` WHERE `Name` = ? AND `Pass` = ?');
		$q->execute(array($_POST['username_'],hash( 'whirlpool',$_POST['password_'])));
		if($q->rowCount()) {
			$d = Config::$g_con->prepare('SELECT * FROM `panel_restrict` WHERE `PlayerName` = ?');
			$d->execute(array($_POST['username_']));
			$row1 = $d->fetch(PDO::FETCH_OBJ);
Before:
Код:
$q = Config::$g_con->prepare('SELECT * FROM `playerinfo` WHERE `Name` = ? AND `Pass` = ?');
		$q->execute(array($_POST['username_'],$_POST['password_']));
		if($q->rowCount()) {
			$d = Config::$g_con->prepare('SELECT * FROM `panel_restrict` WHERE `PlayerName` = ?');
			$d->execute(array($_POST['username_']));
			$row1 = $d->fetch(PDO::FETCH_OBJ);
Reply
#2

I see you use whirlpool, so yes this is the good way.
Reply
#3

The SA-MP whirlpool plugin generates hashed string in uppercase where as php one does in lowercase, you might wanna convert string to uppercase in php first before executing that query.
Reply
#4

Quote:
Originally Posted by BroZeus
Посмотреть сообщение
The SA-MP whirlpool plugin generates hashed string in uppercase where as php one does in lowercase, you might wanna convert string to uppercase in php first before executing that query.
I've never encountered this problem before?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)