Sabtu, 24 Agustus 2013

Latihan PHP 2

Pada Kali ini saya akan memberi Script untuk membuat Biodata pada PHP menggunakan fungsi Variabel.

Script:

<?php
//Variabel yang tertera
$namle='Dimicko Asghary';
$nampa='Miko';
$ttl='Sidoarjo, 02 Agustus 1997';
$umur=16;
$asal='SMPN 1 Kupang';
$ala='Jl.Danau Maninjau 3 G2F/11';
$tb='172/65';
$cc='Manager';
$aga='Islam';
$hob="Wisata Kuliner";

/* Menampilkan Output */
echo "<font color=red size=5> Hello my name is Dimicko Asghary </font>";
?>
<br><br>
<?php echo "<font color=black size=3><b>Data Diri</b></font>"; ?>
<html>
<head>
<body>
    <br><br>
<table border="0">
<tr>
    <td> <?php echo "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<font color=blue size=3><b>Nama Lengkap</b></font>"; ?> </td>
<td> <?php echo "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<font color=green size=4><b>:</b></font>"; ?> </td>
        <td> <?php echo "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;$namle"; ?> </td>
        <td rowspan="10">
<p style=" position:relative;left: 70px;">
<img src="Dimicko.JPG" width="150" height="220">
</p>
</td>
        </tr>
    <tr>
    <td> <?php echo "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<font color=blue size=3><b>Nama Panggilan</b></font>"; ?> </td>
<td> <?php echo "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<font color=green size=4><b>:</b></font>"; ?> </td>
        <td> <?php echo "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;$nampa"; ?> </td>
</tr>
<tr>
    <td> <?php echo "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<font color=blue size=3><b>Tempat, Tanggal Lahir</b></font>"; ?> </td>
<td> <?php echo "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<font color=green size=4><b>:</b></font>"; ?> </td>
        <td> <?php echo "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;$ttl"; ?> </td>
</tr>
<tr>
    <td> <?php echo "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<font color=blue size=3><b>Umur</b></font>"; ?> </td>
<td> <?php echo "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<font color=green size=4><b>:</b></font>"; ?> </td>
        <td> <?php printf ("&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; %.0f", $umur); ?> </td>
</tr>
<tr>
    <td> <?php echo "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<font color=blue size=3><b>Asal SMP</b></font>"; ?> </td>
<td> <?php echo "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<font color=green size=4><b>:</b></font>"; ?> </td>
        <td> <?php echo "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;$asal"; ?> </td>
</tr>
<tr>
    <td> <?php echo "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<font color=blue size=3><b>Alamat</b></font>"; ?> </td>
<td> <?php echo "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<font color=green size=4><b>:</b></font>"; ?> </td>
        <td> <?php echo "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;$ala"; ?> </td>
</tr>
<tr>
    <td> <?php echo "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<font color=blue size=3><b>Tinggi/Berat</b></font>"; ?> </td>
<td> <?php echo "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<font color=green size=4><b>:</b></font>"; ?> </td>
        <td> <?php printf ("&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;%s", $tb); ?> </td>
</tr>
<tr>
    <td> <?php echo "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<font color=blue size=3><b>Cita-Cita</b></font>"; ?> </td>
<td> <?php echo "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<font color=green size=4><b>:</b></font>"; ?> </td>
        <td> <?php echo "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;$cc"; ?> </td>
</tr>
<tr>
    <td> <?php echo "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<font color=blue size=3><b>Agama</b></font>"; ?> </td>
<td> <?php echo "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<font color=green size=4><b>:</b></font>"; ?> </td>
        <td> <?php echo "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;$aga"; ?> </td>
</tr>
<tr>
    <td> <?php echo "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<font color=blue size=3><b>Hobby</b></font>"; ?> </td>
<td> <?php echo "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<font color=green size=4><b>:</b></font>"; ?> </td>
        <td> <?php echo "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;$hob"; ?> </td>
</tr>
</table>
# Akhir Program
</body>
</html>

Output/Hasil

Sekian, Semoga Bermanfaat.........

0 komentar:

Posting Komentar