Exercise Creating Functions for PHP

okay now we try to exercise the functions for PHP
I learned this function from a book that I bought .... then i try or practically exercise:)
discript this we will create 2 tables with the first table in it there are 3 columns
discript this time I make HTML functions in PHP
we sip directly into the script just let me not much
theory  :)

<?
function BukaTabel($warna1, $warna2){
   echo "<table align=center width=\"80%\" border=0 cellspacing=1 cellpadding=0 bgcolor=\"$warna1\"><tr><td>\n";
   echo "<table width=\"100%\" border=0 cellspacing=1 cellpadding=8 bgcolor=\"$warna2\"><tr><td>\n";
   echo "<center>";
   
    }
    function TutupTabel(){
        echo "</td></tr></table></td></tr></table>\n";
         echo "</td></tr></table></td></tr></table>\n";
        }
        ?>


<html>
<head> <title> LatihanFungsi2 </title></head>
<body>
<?php
BukaTabel("red", "#dddddd");
print ("Ini tabel pertama");
print ("<table border=1 width=100%>");
print ("<tr><td width=33% align=center> Kolom1 </td>");
print ("<td width=33% align=center> Kolom2 </td>");
print ("<td width=* align=center> Kolom3 </td> </tr>");
print ("</table>");
TutupTabel();
print ("<br>");
BukaTabel("green", "blue");
print ("Ini tabel kedua");
TutupTabel();
?>
</body>
</html>

Posted in , . Bookmark the permalink. RSS feed for this post.

Leave a Reply

Pages

Search

Sandiah Notes Template Sandroid11.blogspot.com.