サイトは、ヘッダー部、左サイドメニュー部、右コンテンツ部(ここのみframeを使用)の3部構成です。
メニュー部は、
<div id="menu">
<h3>メンテナンスメニュー</h3>
<ul>
<li><a href="***/***/***.php">ユーザ検索</a></li>
<li><a href="***/***/***.php">ユーザ一覧</a></li>
<li><a href="***/***/***.php">ユーザ操作</a></li></ul>
</div>
のようにするつもりですが、
ヘッダー部、
メニュー部、
コンテンツ部(ここのみframe)
それぞれをphpで作成し、
基盤となるファイル(これもphpで)から、これらをincludeしたいと思うのですが、
どのようにしたらよいのか分かりません。
よろしくお願いいたします。
またまた例の1つですが・・・
基本ファイルの一部をリンクに寄って変えるのが難しいのであれば、
それぞれのページから基本部分を呼ぶというのが単純でいいのでは?
contents.php//-----------------------------------------------------
<?php include_once './header.php'; ?>
コンテンツ中身
<?php include_once './fotter.php'; ?>
contents.php//-----------------------------------------------------
header.php//-----------------------------------------------------
<html>
<!--{header}-->
<head>
<title>hogehoge</title>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
</head>
<!--{body}-->
<body>
<div id="wrapper">
<!--{ヘッダー}-->
<div id="header">
<img src="title_image">....
</div>
<!--{メニュー}-->
<div id="left_menu">
<?php include_once './menu.php'; ?>
</div>
<!--{コンテンツここから}-->
<div id="right_contents">
header.php//-----------------------------------------------------
menu.php//-----------------------------------------------------
<!--{↓部分的なHTMLでもOK}-->
<h3>メンテナンスメニュー</h3>
<ul>
<li><a href="***/***/***.php">ユーザ検索<</a></li>
<li><a href="***/***/***.php">ユーザ一覧</a></li>
<li><a href="***/***/***.php">ユーザ操作</a>
</ul>
<h3>システムメニュー
<ul>
<?php
for($i = 0; $i < count($ret);$i++){
echo "<li><a href='".$ret[$i][url]."'>".$ret[$i][title]."";
}
?>
</ul>
menu.phpここまで//-------------------------------------------------
fotter.php//-----------------------------------------------------
</div><!--right_contents-->
</div><!--wrapper-->
</body>
</html>
fotter.php//-----------------------------------------------------
contents.phpをコピペして、中身だけ変えていく、とか??
contents2.php//-----------------------------------------------------
<?php include_once './header.php'; ?>
コンテンツ2中身
<?php include_once './fotter.php'; ?>
contents2.php//-----------------------------------------------------
こんな感じでも、http://www.1kara.net/js/できますよね?
あくまで記入例の1つですが・・・
基本ファイルPHP//-----------------------------------------------------
<html>
<!--{header}-->
<head>
<title>hogehoge</title>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
</head>
<!--{body}-->
<body>
<div id="wrapper">
<!--{ヘッダー}-->
<div id="header">
<?php include_once './header.php'; ?>
</div>
<!--{メニュー}-->
<div id="left_menu">
<?php include_once './menu.php'; ?>
</div>
<!--{コンテンツ}-->
<div id="right_contents">
<?php include_once './contents.php'; ?>
</div>
</div>
</body>
</html>
基本ファイルPHP ここまで//-------------------------------------------
メニューPHP//-----------------------------------------------------
<!--{↓部分的なHTMLでもOK}-->
<h3>メンテナンスメニュー</h3>
<ul>
<li><a href="***/***/***.php">ユーザ検索<</a></li>
<li><a href="***/***/***.php">ユーザ一覧</a></li>
<li><a href="***/***/***.php">ユーザ操作</a>
</ul>
<!--{↓こんな風にPHPをかいてもOK}-->
<h3>システムメニュー
<ul>
<?php
for($i = 0; $i < count($ret);$i++){
echo "<li><a href='".$ret[$i][url]."'>".$ret[$i][title]."";
}
?>
</ul>
メニューPHPここまで//-------------------------------------------------
こんなイメージですか??
またまた例の1つですが・・・
基本ファイルの一部をリンクに寄って変えるのが難しいのであれば、
それぞれのページから基本部分を呼ぶというのが単純でいいのでは?
contents.php//-----------------------------------------------------
<?php include_once './header.php'; ?>
コンテンツ中身
<?php include_once './fotter.php'; ?>
contents.php//-----------------------------------------------------
header.php//-----------------------------------------------------
<html>
<!--{header}-->
<head>
<title>hogehoge</title>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
</head>
<!--{body}-->
<body>
<div id="wrapper">
<!--{ヘッダー}-->
<div id="header">
<img src="title_image">....
</div>
<!--{メニュー}-->
<div id="left_menu">
<?php include_once './menu.php'; ?>
</div>
<!--{コンテンツここから}-->
<div id="right_contents">
header.php//-----------------------------------------------------
menu.php//-----------------------------------------------------
<!--{↓部分的なHTMLでもOK}-->
<h3>メンテナンスメニュー</h3>
<ul>
<li><a href="***/***/***.php">ユーザ検索<</a></li>
<li><a href="***/***/***.php">ユーザ一覧</a></li>
<li><a href="***/***/***.php">ユーザ操作</a>
</ul>
<h3>システムメニュー
<ul>
<?php
for($i = 0; $i < count($ret);$i++){
echo "<li><a href='".$ret[$i][url]."'>".$ret[$i][title]."";
}
?>
</ul>
menu.phpここまで//-------------------------------------------------
fotter.php//-----------------------------------------------------
</div><!--right_contents-->
</div><!--wrapper-->
</body>
</html>
fotter.php//-----------------------------------------------------
contents.phpをコピペして、中身だけ変えていく、とか??
contents2.php//-----------------------------------------------------
<?php include_once './header.php'; ?>
コンテンツ2中身
<?php include_once './fotter.php'; ?>
contents2.php//-----------------------------------------------------
こんな感じでも、http://www.1kara.net/js/できますよね?
すみません、ご返信遅くなりました。
大変分かりやすく参考になりました。
ありがとうございます。
実は教えていただいた部分まではその後
自力で分かったのですが、
メニューにて選択したコンテンツを
左部分のコンテンツ部分に表示させる方法が分かりません。
「*****.php」のようなファイル名を動的に取得して
コンテンツ部分に実行する、
ということになるかと思うのですが・・