A simple template for quick and dirty PHP apps.
您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符

required.php 721B

1234567891011121314151617181920212223242526
  1. <?php
  2. /* This Source Code Form is subject to the terms of the Mozilla Public
  3. * License, v. 2.0. If a copy of the MPL was not distributed with this
  4. * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
  5. require_once __DIR__ . "/settings.php";
  6. require_once __DIR__ . "/vendor/autoload.php";
  7. use Medoo\Medoo;
  8. $database;
  9. try {
  10. $database = new Medoo([
  11. 'database_type' => DB_TYPE,
  12. 'database_name' => DB_NAME,
  13. 'server' => DB_SERVER,
  14. 'username' => DB_USER,
  15. 'password' => DB_PASS,
  16. 'charset' => DB_CHARSET
  17. ]);
  18. } catch (Exception $ex) {
  19. header('HTTP/1.1 500 Internal Server Error');
  20. die("Database error. Try again later. (" . $ex->getMessage() . ")");
  21. }