Membuat Modul Program
1. Kegunaan
~ Memudahkan
desain
~ Memisahkan
konten (isi dan desain)
~ Dapat
berisi script PHP dan Html.
2. Memanggil
Modul Program
Require (nama modul)
Contoh
1. Header PHP
<Html>
<head> <tittle>
</tittle> </head>
<body>
<H1>
SMK
N 1 KOTAMOBAGU
</H1>
<Hr>
2. Footer PHP
<p>
<Hr>
© SMK N 1
KOTAMOBAGU 2012
</body>
</html>
3. Contoh PHP
<?
Require (“header.php”) ; ?>
Ini
halaman 1
Menuju
halaman <a href = contoh.2.php> 2 </a>
<?require
(“footer.php”) ; ?>
4. Contoh
2.php
<?
Require (“header.php”) ; ?>
Ini
halaman 2
Menuju
halaman <a href = contoh.1.php> 2 </a>
<?require
(“footer.php”) ; ?>
5. Jika ingin
melakukan perubahan tampilan cukup merubah bagian header & footer.
Tidak ada komentar:
Posting Komentar