Sabtu, 07 Desember 2013

Membuat Tampilan Website Menggunakan Modularisasi (Praktikum PHP 5)

1. Buka aplikasi Dreamweaver. Klik File>New dipojok kiri atas klik Create. Buat file php dengan nama phpheader.php
2. Ketikkan script berikut.
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Tugas PHP 5</title>
</head>
<body background="log-background-feature-header.jpg">
<center>
<?php
$kalimat='Its All About Friendship';
function tulistebal($text){
echo "<b>$text</b>";
}
?>
<br />
<img src="C360_2013-10-30-13-59-27-302.jpg" height="300" width="500" style="border-style:groove; border-radius:50px"/>
 <hr color="#330000" size="15" width="1300px" />
</center>
</body>
</html>
Kemudian klik live view. Maka tampilannya sebagai berikut.
 
3. Buat file php baru lagi dengan nama phpcontent.php.
4. Ketikkan script berikut di workspace.
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Content</title>
</head>
<body background="log-background-feature-header.jpg">
<p align="justify">
<font face="Lucida Calligraphy" color="white">
During our life, there are many persons will fulfill and complete our life.But not all persons will leave memories and make a sign in our heart. It's not just the great things, but also the hurt. Although we didnt want that, but it will appear too.<br />
Like a friendship, not forever giving us a happy memories
A friendship could give us a happiness. And maybe one day, they will lose it all just because a mistake. Because a mistake, we leave them. We stay away from them, we throw them out from our life.<br />
<center><img src="C360_2013-10-30-13-57-48-232.jpg" border="1" style="border-radius:50px" width="400" height="250"/><br /></center>
But remember back, when we're happy together. We're sharing and support each other. All laugh and smile that which ever happen. Where are they gone? Where to find it again?<br />
Until in the end, we feel alone and dont have a friend to share. Until in the end, we realize how hard to find friend. Until in the end, we regret because leave them just for a mistake. And 'til the end, we feel that we didn't need a friend.<br />
Do u know what's the meaning of a friendship? All i know, a friend will appear without we guess. They will enter our life like an infiltrator. They will infect our act. And will make a big change in our life. They will disapper one time later, but we'll always feel they apperance in our heart.<br />
Our memories wont ever go from our head. How far they gone, make a scar, have go away. But a friend will come in every dream. Appear in our memories. And will be there, in our heart.<br />
That's why, we need to appreciate of all our friend that we have for now. Maybe they didnt as good as u want. Or they didnt as perfect as u wish. But, a friend which ever being our friend, will always there in your deepest heart.<br />
Friendship is like Studying. Try to understand, try to appreciate each other. Try to forgive each other, and try to love. Try to listen, and try to give command.<br />
How bad a friend hurt us, just try to forgive and forget it and forever that friendship wont ever be broke. Let friendship that we ever have will always rotate like a wheel of life, not just a life line that will have an end.<br />
<center>
<img src="C360_2013-10-30-13-57-00-753.jpg" border="1" style="border-radius:50px" width="400" height="250"/>
</center>
</font>
</body>
</html>
Kemudian klik live view. Maka tampilannya sebagai berikut.
 
5. Buat file php baru dengan nama phpfooter.php dan ketikkan script berikut.
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Footer</title>
</head>
<body background="log-background-feature-header.jpg">
<center>
<font face="Lucida Calligraphy" color="white">
<hr color="#330000" size="15" width="1300px" />
        Design by : Anes Paraswati T. / XI RPL 1 / 02 2013
        <hr color="#330000" size="15" width="1300px" />
</font>
  </center>
</body>
</html>
Kemudian klik live view maka hasilnya sebagai berikut.
 

 6. Buat file php yang terakhir, beri nama gabunganphp5.php dan ketikkan script berikut.
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>PHP 5</title>
</head>
<body>
<center>
<?php
require("phpheader.php");
tulistebal(" ");
echo "<br><br>";
echo "<font size=50 color=white><b>$kalimat</b></font>";
require("phpcontent.php");
require("phpfooter.php");
?>
</center>
</body>
</html>
7. Tekan F12 untuk melihat hasilnya di browser. Maka hasilnya akan sebagai berikut.
Ketiga file phpheader.php, phpcontent.php, dan phpfooter.php akan ditampilkan dalam satu file gabungan.

Tidak ada komentar:

Posting Komentar