for - 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 for.php
- <!DOCTYPE html>
- <html>
- <head>
- <title>Studi Kasus For</title>
- <style>
- body{
- background-color: gray;
- font-family: cursive;
- }
- input{
- border-radius: 5px;
- }
- button{
- background-color: yellow;
- border: 1px solid black;
- color: black;
- }
- </style>
- </head>
- <body>
- <div class="inputan">
- <form action="" method="post">
- <h1>
- Form Input Data Siswa</h1>
- Masukkan jumlah siswa <input type="text" name="jumlah">
- <button type="submit">Enter</button>
- </form>
- <br>
- </div>
- <table cellspacing="0" cellpadding="2" border="1">
- <tr>
- <th>No</th>
- <th>Nis</th>
- <th>Nama</th>
- <th>Alamat</th>
- </tr>
- <?php
- $jumlah = (int)$_POST['jumlah'];
- for($i=1;$i<=$jumlah;$i++){
- echo <<<aw
- <tr>
- <td><input type="text" name="" value=$i></td>
- <td><input type="text" name=""></td>
- <td><input type="text" name=""></td>
- <td><input type="text" name=""></td>
- </tr>
- aw;
- }
- ?>
- </table>
- </body>
- </html>
File Description
- for
- PHP Code
- 29 Oct-2019
- 994 Bytes
You can Share it:
Latest PHP Pastes