<html>
<head>
    <title>Latihan Form Biodata</title>
</head>
<body>

<form action="" method="POST">
    Nama       : <input type="text" name="nama" /><br />
    Umur       : <input type="text" name="umur" /><br />
    Gender     :
        <input type="radio" name="gender" value="Pria" /> Pria
        <input type="radio" name="gender" value="Wanita" /> Wanita
    <br />
    Hobi       :
        <input type="checkbox" name="hobi[]" value="Travelling" /> Travelling
        <input type="checkbox" name="hobi[]" value="Shopping" /> Shopping
    <br />
    Pendidikan : 
        <select name="pendidikan">
            <option value="SD">SD</option>
            <option value="SMP">SMP</option>
            <option value="SMA">SMA</option>
            <option value="D3">D3</option>
            <option value="S1">S1</option>
        </select>
    <br />
    Alamat     : <br />
        <textarea name="alamat" rows="4" cols="30"></textarea>
    <br />
    <input type="submit" name="ok" value="OK" />
</form>

<?php
if (isset($_POST["ok"])) {
    // Gabungkan hobi yang dicentang (bisa lebih dari 1) jadi 1 string
    $hobi = isset($_POST["hobi"]) ? implode(", ", $_POST["hobi"]) : "-";
    ?>
    <h3>Biodata</h3>
    <table>
        <tr><td>Nama</td><td>:</td><td><?php echo $_POST["nama"]; ?></td></tr>
        <tr><td>Umur</td><td>:</td><td><?php echo $_POST["umur"]; ?></td></tr>
        <tr><td>Gender</td><td>:</td><td><?php echo $_POST["gender"]; ?></td></tr>
        <tr><td>Hobi</td><td>:</td><td><?php echo $hobi; ?></td></tr>
        <tr><td>Pendidikan</td><td>:</td><td><?php echo $_POST["pendidikan"]; ?></td></tr>
        <tr><td>Alamat</td><td>:</td><td><?php echo $_POST["alamat"]; ?></td></tr>
    </table>
    <?php
}
?>

</body>
</html>