mirror of
https://github.com/Aviortheking/Blog_IMIE.git
synced 2025-06-22 22:39:19 +00:00
il n'y a pas eu de leak de mot de passe ici ;)
This commit is contained in:
20
project/assets/php/functions.php
Normal file → Executable file
20
project/assets/php/functions.php
Normal file → Executable 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() {
|
||||
|
||||
}
|
||||
|
Reference in New Issue
Block a user