<?php require_once "../boot.php"; $dbCon = new DbConn(); require_once APP_INC_DIR . "incColumnShow.php"; $smarty = new SmartyEx(); if (!validatePath($_GET["id"])) { $smarty->showErrorPage(404); exit; } $ColumnShow = new ColumnShow($dbCon, $smarty); // キーを設定 $ColumnShow->SetColPath($_GET["id"]); // データベースからデータをセット $isData = $ColumnShow->SetDbData(); if ($isData) { $smarty->display("column/column.html"); } else { $smarty->showErrorPage(404); } function validatePath($str) { if (strlen($str) <= 1) { return false; } if (strlen($str) >= 3) { if (preg_match("/^[0]+/", $str)) { return false; } } return true;
<?php require_once "../boot.php"; $dbCon = new DbConn(); require_once APP_INC_DIR . "incColumnShow.php"; $smarty = new SmartyEx(); $ColumnShow = new ColumnShow($dbCon, $smarty); // キーを設定 $ColumnShow->SetKey($_GET["id"]); // データベースからデータをセット $isData = $ColumnShow->SetDbData(); if ($isData) { $smarty->display("column/column.html"); } else { $smarty->showErrorPage(404); }