Pemrograman Web : Cara Membuat Case di PHP - Tutorial Teknologi Kuliah

Blogger

  • Tutorial
  • Teknologi
  • Kuliah
  • UTM

Hot

Monday, 25 April 2016

Pemrograman Web : Cara Membuat Case di PHP

langsung aja gan kodingnya ada di bawah ini, dan jika ada pertanyaan silahkan tanyakan di komentar, semoga bermanfaat

<html><body>
<form name="Mata Kuliah" method="post" action="index.php">
<table>
                <tr>
                <td colspan="2"><div align="center">Mata Kuliah</div></td>
                </tr>
                <tr>
                <td>Nama Hari</td>
                <td><select name="Hari">
                                <option value="Sn">Senin</option>
                                <option value="Sl">Selasa</option>
                                <option value="Rb">Rabu</option>
                                <option value="Km">Kamis</option>
                </select></td></tr><tr>
                <td><input type="submit" name="pilih" value="pilih"></td></tr>
</table></form><?php
                $NamaHari=$_POST['Hari'];
                switch($NaqmaHari){
                case"Sn":
                                print("Mata Kuliah hari senin adalah : <br>");
                                print(" - SISTEM INFORMASI<br>");
                                print(" - KECERDASAN BUATAN<br>");
                                print(" - KOMUNIKASI DATA<br>");
                                print(" - PRAKTIKUM WEB<br>");
                                break;
                case"Sl":
                                print("Mata Kuliah hari selasa adalah : <br>");
                                print(" - PBO<br>");
                                print(" - STATISTIK<br>");
                                print(" - RISET OPERASI<br>");
                                break;
                case"Rb":
                                print("Mata Kuliah hari rabu adalah : <br>");
                                print(" - RPL<br>");
                                break;
                case"Km":
                                print("Mata Kuliah hari kamis adalah : <br>");
                                print(" - PEMWEB<br>");
                                print(" - PEMVIS2<br>");
                                break;}
?>
</body>
</html>

Hasil Running


No comments:

Post a Comment