Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <!DOCTYPE html>
- <html>
- <head>
- <title>Kasus 1 (M. Hafidz Fadillah - XI RPL 2)</title>
- <style type="text/css">
- body{
- font-family: verdana;
- }
- form{
- width: 670px;
- }
- table{
- width: 650px;
- text-align: center;
- margin-right: auto;
- margin-left: auto;
- background-color: lightgray;
- border: 3px dimgray outset;
- }
- </style>
- </head>
- <body>
- <form method="post" action="">
- <h1>Form Input Data Siswa</h1>
- <p>Masukkan jumlah Siswa <input type="number" name="j_siswa"> <input type="submit" name="submit" value="ok"></p>
- <table cellspacing="1" cellpadding="1" >
- <tr>
- <td>No</td>
- <td>NIS</td>
- <td>Nama</td>
- <td>Alamat</td>
- </tr>
- <?php
- if (isset($_POST['submit'])) {
- $siswa = $_POST['j_siswa'];
- for ($i=1; $i <= $siswa; $i++) {
- echo "<tr>
- <td><input type='text' name='no' value='$i'size='1'></td>
- <td><input type='text' name='nis'></td>
- <td><input type='text' name='nama'></td>
- <td><input type='text' name='alamat'></td>
- </tr>";
- }
- }
- ?>
- </table>
- </form>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement