il n'y a pas eu de leak de mot de passe ici ;)

This commit is contained in:
2019-01-28 16:25:30 +01:00
parent e2f71dd59b
commit 7a8dcd2da1
30 changed files with 254 additions and 285 deletions

20
project/assets/php/functions.php Normal file → Executable file
View File

@ -9,3 +9,23 @@ function endsWith($haystack, $needle) {
return (substr($haystack, -$length) === $needle);
}
function connect() {
$host = "127.0.0.1";
$db = "blog";
$user = "username";
$pass = "motdepasse";
$charset="utf8mb4";
$dsn = "mysql:host=$host;dbname=$db;charset=$charset";
try {
$pdo = new PDO($dsn, $user, $pass);
} catch (\PDOException $e) {
throw new \PDOException($e->getMessage(), (int)$e->getCode());
}
return $pdo;
}
function getBDD() {
}