SA-MP Forums Archive
Newbie to PHP - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: Other (https://sampforum.blast.hk/forumdisplay.php?fid=7)
+--- Forum: Everything and Nothing (https://sampforum.blast.hk/forumdisplay.php?fid=23)
+--- Thread: Newbie to PHP (/showthread.php?tid=620064)



Newbie to PHP - qUneT - 25.10.2016

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);



Re: Newbie to PHP - BlackBank - 30.10.2016

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


Re: Newbie to PHP - BroZeus - 31.10.2016

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.


Re: Newbie to PHP - Luis- - 31.10.2016

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?