Files
hmac_BUT/src/index.php

56 lines
1.4 KiB
PHP

<?php
// Entry bootstrap for hmac_edu: load DB config and show skin/index.php as intro
$base = __DIR__;
// Load DB connection if present (bbs/db_conn.php contains DB info)
if (file_exists($base . '/bbs/db_conn.php')) {
require_once $base . '/bbs/db_conn.php';
} elseif (file_exists($base . '/db_conn.php')) {
require_once $base . '/db_conn.php';
}
// Serve skin/index.php as the intro page if it exists
$skin = $base . '/skin/index.php';
if (file_exists($skin)) {
if (session_status() === PHP_SESSION_NONE) {
@session_start();
}
require $skin;
exit;
}
// Try alternate locations (compat)
$alt = $base . '/hmac_edu/index.php';
if (file_exists($alt)) {
require $alt;
exit;
}
// Fallback diagnostic page
$dirs = [];
foreach (scandir($base) as $d) {
if ($d === '.' || $d === '..') continue;
if (is_dir($base . '/' . $d)) $dirs[] = $d;
}
?><!DOCTYPE html>
<html lang="ko">
<head>
<meta charset="utf-8">
<title>hmac_edu - Missing Intro</title>
<style>body{font-family:Arial,Helvetica,sans-serif;padding:20px}</style>
</head>
<body>
<h1>Intro 페이지를 찾을 수 없습니다</h1>
<p>현재 `skin/index.php` 파일이 프로젝트의 `src` 폴더에 없습니다.</p>
<p>호스트에 업로드된 디렉터리 목록:</p>
<ul>
<?php foreach ($dirs as $d): ?>
<li><?php echo htmlspecialchars($d); ?></li>
<?php endforeach; ?>
</ul>
</body>
</html>
<?php
// end
?>