vin - 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.



Your result can be seen below.

Result of php executing





Full code of vin.php

  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4.     <meta charset="UTF-8">
  5.     <meta name="viewport" content="width=device-width, initial-scale=1.0">
  6.     <meta http-equiv="X-UA-Compatible" content="ie=edge">
  7.     <title>Data Siswa</title>
  8. </head>
  9. <body>
  10.     <table border="1" cellpadding = 5px>
  11.         <thead>
  12.             <tr>
  13.                 <th>#</th>
  14.                 <th>NIS</th>
  15.                 <th>Nama Lengkap</th>
  16.                 <th>Jenis Kelamin</th>
  17.                 <th>Kelas</th>
  18.                 <th>Jurusan</th>
  19.                 <th>Alamat</th>
  20.                 <th>Golongan Darah</th>
  21.                 <th>Nama Wali</th>
  22.                 <th>Aksi</th>
  23.             </tr>
  24.         </thead>
  25.         <tbody>
  26.             <?php
  27.                 $i = 1;
  28.                 while ($siswa = $listSiswa->fetch_array()) {
  29.                     ?>
  30.             <tr>
  31.                 <td><?= $i++?></td>
  32.                 <td><?= $siswa['nis']?></td>
  33.                 <td><?= $siswa['nama_lengkap']?></td>
  34.                 <td><?= $siswa['jenis_kelamin']?></td>
  35.                 <td><?= $siswa['kelas']?></td>
  36.                 <td><?= $siswa['jurusan']?></td>
  37.                 <td><?= $siswa['alamat']?></td>
  38.                 <td><?= $siswa['golongan_darah']?></td>
  39.                 <td><?= $siswa['nama_wali']?></td>
  40.                 <td>
  41.                     <a href="edit.php?nis=<?= $siswa['nis']?>">Edit</a>
  42.                 </td>
  43.             </tr>
  44.             <?php } ?>
  45.         </tbody>
  46.     </table><br><br>
  47.     <a href="tambah.php">Tambah Data</a><br><br>
  48. </body>
  49. </html>
File Description
  • vin
  • PHP Code
  • 23 Oct-2019
  • 1.56 Kb
You can Share it: