这是config.php文件
<?php
error_reporting(E_ALL ^ E_NOTICE);
/*=========== Database Configuraiton ==========*/
$db_host = "localhost";
$db_user = "test";
$db_pass = "test";
$db_name = "dbtest";
/*=========== Website Configuration ==========*/
$defaultTitle = 'testing';
$defaultFooter = date('Y').' © testing';
?>
Run Code Online (Sandbox Code Playgroud)
这是对config.php的引用
<?php
require_once "includes/config.php";
require_once "includes/connect.php";
require_once "includes/helpers.php";
header('Cache-Control: max-age=3600, public');
header('Pragma: cache');
header("Last-Modified: ".gmdate("D, d M Y H:i:s",time())." GMT");
header("Expires: ".gmdate("D, d M Y H:i:s",time()+3600)." GMT");
?>
Run Code Online (Sandbox Code Playgroud)
Connect.php如下
<?php
/*
The login details are taken from config.php.
*/
try {
$db = new PDO(
"mysql:host=$db_host;dbname=$db_name;charset=UTF-8", …
Run Code Online (Sandbox Code Playgroud)