
//どこから来たか判断 $content_name = (isset($_GET['p'])) ? $_GET['p'] : ''; //コンテンツリスト $content_list[] = 'works'; $content_list[] = 'workflow'; $content_list[] = 'price'; $content_list[] = 'contact'; $content_list[] = 'sitemap'; //ソースパス生成 $file_path = dirname(__FILE__) . '/common/'; $tpl_path = $file_path . 'tpl/'; $src_path = $file_path . 'src/'; //コンテンツリストに登録しているもの以外は除外する //メールフォーム処理 if($content_name == 'contact' && $_GET[a] == 'conf'){ $file = $src_path . 'sendmail.php'; }elseif($content_name == 'contact' && $_GET[a] == 'done'){ $file = $src_path . 'sendmail.php'; }elseif(!in_array($content_name, $content_list)){ $file = $tpl_path . 'top.tpl'; }else{ $file = $tpl_path . $content_name . '.tpl'; } //ファイルが存在するか調べる if(!file_exists($file)){ $file = $tpl_path . 'top.tpl'; } ?>