gaku-ura/hide_php/story.php

40 行
812 B
PHP

<?php
//直接アクセスしちゃ駄目
require $d_root.'/hide_php/conf/c.php';
$story = 'index';
if (isset($_GET['Story'])){
if (preg_match('/^([0-9]|[a-z]|[A-Z]|_|-)+$/', $_GET['Story']) === 1){
$story = $_GET['Story'];
}
}
$html_file = $d_root.'/sqlike/html/story/'.$story.'.html';
if (!file_exists($html_file)){
not_found();
}
$head = explode("'", get($html_file, 1));
$title = $head[0];
if ($head[1] === 'noindex'){
$robots = false;
} else {
$robots = true;
}
$html = implode(get_rows($html_file, 2));
$wrap = '</div>';
##########html開始
html_head($title.'-', '', $d_root.'/sqlike/css/story/novel.css,', $robots);
echo '<div class="wrap"><h1>'.$title.'</h1>';
echo $html;
if ($story !== 'index'){
echo '<p class="m"><a href="./">小説一覧へ戻る</a></p>';
}
html_foot('', $wrap);