global $name; require("./lib/const.php"); // DB接続 require("./common/env.php"); session_start(); $_SESSION["name"]= $name; $name_ses = $_SESSION["name"]; if($name != $name_ses) { $m_url=$m_url."./error.htm"; header("Location: ".$m_url); exit(); } if($name ==""){ $m_url=$m_url."./error.htm"; header("Location: ".$m_url); exit(); } $PC_NAME = $name; SetCookie ("PC_NAME","$PC_NAME",time()+60*60*24*30,"/",""); $arrBookid = array(); $arrTitle = array(); $arrAuther = array(); $arrRecommend = array(); $newURL = "./bookupdate.php"; $updURL = "./bookupdate.php?bookid="; // bookshelf テーブルから値取得 $SQL = "SELECT bookid, title, auther, recommend FROM bookshelf WHERE delFlg=0 ORDER BY bookid"; $result = mysql_query($SQL); if($result == FALSE) { echo "データベースエラー!\n"; exit; } $num_rows = mysql_num_rows($result); // 取得レコード件数 $i = 0; while($row = mysql_fetch_array($result)){ // 取得結果を配列に保存 $arrBookid[$i] = $row[0]; $arrTitle[$i] = $row[1]; $arrAuther[$i] = $row[2]; $arrRecommend[$i] = $row[3]; $i++; } mysql_free_result($result); require("./lib/concls.php"); // DB切断 $hour = date( "H" ); if( $hour <= 3 ){ $time_msg="遅い時間にこんばんわ。"; } elseif (( $hour >= 4 )&&( $hour <= 11 )) { $time_msg="おはようございます。"; } elseif (( $hour >= 19 )&&( $hour <= 24 )) { $time_msg="こんばんわ。"; } else { $time_msg="こんにちわ。"; } ?>
N0. | タイトル | 著者 | オススメ度 |
$roop | "); print("$arrTitle[$i] | "); print("$arrAuther[$i] | "); print("$arrRecommend[$i] | "); print("