20.02.2018, 08:56
Im wondering how to hash passwords with sqlite both compatible with PHP and PAWN.
I am converting my server into sqllite and i am building a ucp as well.
The thing is, that the password is not hashed currently.
Does anybody know which kind of encryption i can use? and how?
I doubt it will be needed but if so:
PHP Login:
The code above currently logs in without any encryption.
I am converting my server into sqllite and i am building a ucp as well.
The thing is, that the password is not hashed currently.
Does anybody know which kind of encryption i can use? and how?
I doubt it will be needed but if so:
PHP Login:
PHP код:
<?php
error_reporting(E_ALL);
class MyDB extends SQLite3
{
function __construct()
{
$this->open('LARPSERVER/scriptfiles/Data/database/testdatabase.db');
}
}
$db = new MyDB() or die ("Unable to open");
$sql = 'SELECT * FROM USERS WHERE MAIL="'.$_POST["MAIL"].'" AND PASSWORD="'.$_POST["PASSWORD"].'"';
$stmt = $db->query($sql);
while($row = $stmt->fetchArray(SQLITE3_ASSOC) )
{
$email_address = $row["MAIL"];
$password = $row["PASSWORD"];
if($password==$_POST["PASSWORD"])
{
echo "<h1>Logged In</h1>";
echo "ID = ". $row['ID'] . "<br>";
echo "NAME = ". $row['NAME'] . "<br>";
echo "USERNAME = ". $row['USERNAME'] . "<br>";
echo "MAIL = ". $row['MAIL'] . "<br>";
}
}
while(!$row = $stmt->fetchArray(SQLITE3_ASSOC) )
{
exit("<h1>faild</h1>");
}
$db->close();
?>

