gitignore
這個提交存在於:
父節點
d065dc4857
當前提交
e910bc5f25
共有 2 個檔案被更改,包括 15 行新增 和 0 行删除
0
script/.htpassdb
一般檔案
0
script/.htpassdb
一般檔案
15
script/db.php
一般檔案
15
script/db.php
一般檔案
|
|
@ -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());
|
||||
?>
|
||||
載入中…
新增問題並參考