PHPStarter/public/index.php

35 lines
734 B
PHP

<?php
require_once __DIR__ . '/../vendor/autoload.php';
use Dotenv\Dotenv;
$dotenv = Dotenv::createImmutable(__DIR__ . '/../config', 'PHPStarter.env');
$dotenv->load();
use PHPStarter\DB;
$pdo = DB::connect();
$query = "SELECT * FROM `PHPStarter` WHERE `id` = 1";
$stmt = $pdo->prepare($query);
$stmt->execute();
$PHPStarter = $stmt->fetch();
?>
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title><?= $PHPStarter->message ?></title>
<link rel="stylesheet" type="text/css" href="./css/PHPStarter.css">
<link rel="icon" type="image/x-icon" href="./icons/favicon.ico">
</head>
<body>
<h1><?= $PHPStarter->message ?></h1>
<script type="text/javascript" src="./js/PHPStarter.js"></script>
</body>
</html>