for2 - PHP Online
Form of PHP Sandbox
Enter Your PHP code here for testing/debugging in the Online PHP Sandbox. As in the usual PHP files, you can also add HTML, but do not forget to add the tag <?php
in the places where the PHP script should be executed.
Result of php executing
Full code of for2.php
- <!DOCTYPE html>
- <html>
- <head>
- <title>Studi Kasus For 2</title>
- <style>
- body{
- background-color: cyan;
- font-family: cursive;
- }
- input{
- border-radius: 5px;
- }
- button{
- background-color: red;
- color: white;
- border: 1px solid black;
- }
- </style>
- </head>
- <body>
- <form method="POST" action="">
- <table>
- <tr>
- <th colspan="3">Daftar Jurusan Siswa</th>
- </tr>
- <tr>
- <td>Masukkan jumlah Data:</td>
- <td><input type="text" name="jumlah"></td>
- <td><button type="submit">Ok</button></td>
- </tr>
- </table>
- <br>
- </form>
- <table border="1" cellspacing="0" cellpadding="5">
- <?php
- $jumlah = (int)$_POST['jumlah'];
- for($i=1;$i<=$jumlah;$i++){
- echo <<<kok
- <tr>
- <td>Nama</td>
- <td><input type="text" name=""></td>
- <td>Jurusan</td>
- <td><input type="radio" name="jurusan">RPL</td>
- <td><input type="radio" name="jurusan">TKJ</td>
- <td><input type="radio" name="jurusan">MM</td>
- <td><input type="radio" name="jurusan">AV</td>
- <td><input type="radio" name="jurusan">TITL</td>
- <td><input type="radio" name="jurusan">TOI</td>
- </tr>
- kok;
- }
- ?>
- </table>
- </body>
- </html>
File Description
- for2
- PHP Code
- 29 Oct-2019
- 1.17 Kb
You can Share it:
Latest PHP Pastes