Compare commits

...

2 commits

Author SHA1 Message Date
Baptiste
db79263647 Merge remote-tracking branch 'refs/remotes/origin/master' 2022-10-15 16:49:51 +02:00
Baptiste
e910bc5f25 gitignore 2022-10-15 16:48:20 +02:00
2 changed files with 15 additions and 0 deletions

0
script/.htpassdb Normal file
View file

15
script/db.php Normal file
View file

@ -0,0 +1,15 @@
<?php
function read_password()
{
$real_path = __DIR__.DIRECTORY_SEPARATOR.".htpassdb";
$file = fopen($real_path, "r") or die("Unable to open DB password file!");;
$password = fgets($file);
fclose($file);
return trim($password);
}
$host = "127.0.0.1";
$db = new PDO('mysql:host='.$host.';dbname=accueil_insa','root', read_password());
?>