<?php //===================================== // モンスターデータ 個別データ閲覧用 //===================================== require_once "/var/www/class/mysql.php"; require_once "/var/www/class/guestdata.php"; require_once "/var/www/functions/template.php"; require_once "/var/www/functions/monster.php"; $category = monster_category(); $walkspeed = monster_walkspeed(); $search = monster_search(); if (isset($_GET['id']) && is_numeric($_GET['id'])) { $zone = floor($_GET['id'] / 10000); $id = $_GET['id'] % 10000; } else { $zone = 0; $id = 0; } $user_file = "/etc/mysql-user/user5000.ini"; if ($fp_user = fopen($user_file, "r")) { $userName = rtrim(fgets($fp_user)); $password = rtrim(fgets($fp_user)); $database = rtrim(fgets($fp_user)); } else { die("接続設定の読み込みに失敗しました"); } $data = new GuestData($userName, $password, $database); if (mysqli_connect_error()) { die("データベースの接続に失敗しました"); }
<?php //===================================== // モンスターデータ リスト閲覧用 //===================================== require_once "/var/www/class/mysql.php"; require_once "/var/www/class/guestdata.php"; require_once "/var/www/class/admindata.php"; require_once "/var/www/functions/template.php"; require_once "/var/www/functions/monster.php"; $cname = monster_category(); session_start(); if (isset($_GET['id']) && is_numeric($_GET['id'])) { $id = $_GET['id']; } else { $id = -1; } $user_file = "/etc/mysql-user/user5000.ini"; if ($fp_user = fopen($user_file, "r")) { $userName = rtrim(fgets($fp_user)); $password = rtrim(fgets($fp_user)); $database = rtrim(fgets($fp_user)); } else { die("接続設定の読み込みに失敗しました"); } if (isset($_SESSION["user"]) && isset($_SESSION["pass"])) { $data = new AdminData($_SESSION["user"], $_SESSION["pass"], "ezdata"); if (!$data->is_admin) { session_destroy(); die("データベースの接続に失敗しました"); }