私はPHPを学び始めたばかりです。
各 PHP サイトにテンプレート ヘッダーを含めるために include_once 関数を使用しようとしています。
(また、これはこのサイトでの私の最初の投稿であり、それがどのように機能するのかよくわかりません... 4 スペースのインデントに気付きました)
このビデオを見ています: http://www.youtube.com/watch?v=65gV8JOgWkQ&feature=relmfu
そして、19:00 頃から、アドバイスに従ってこのコードを DW CS5 に入力しました。
これは私のindex.phpファイルです:
<body>
<div align="center" id="mainWrapper">
<?php inlude_once("/Users/patrickmeaney/localhost/BobsSuits/template_header.php"); ?>
<?php include_once dirname("/Users/patrickmeaney/localhost/BobsSuits/template_header.php"); ?>
<div id="pageContent"> test</div>
<?php inlude_once("template_footer.php");?>
</div>
</body>
これは私の template_header ページです:
<div id="pageHeader"><table width="100%" border="1">
<tr>
<td width="49%"><img src="style/bobssuitslogo.png" width="433" height="92" alt="Logo" /></td>
<td width="51%"> </td>
</tr>
<tr>
<td colspan="2"><a href="index.php">Home</a> <a href="#">Link 1</a> <a href="#">Link 2</a> <a href="#">Link 3</a></td>
</tr>
</table>
</div>