Menu

Senin, 02 September 2019

Materi 8 Membuat file update.php berupa formulir

<html>
<head>
            <title>Edit Data </title>
            <style type="text/css">
            .labelfrm{
                  display:block;
                  font-size:small;
                  margin-top:5px;
            }
            .error{
                  font-size:small;
                  color:red;
            }
            </style>
      </head>
      <body align="center">
       
<?php
include "menu.php";
?>
   
       


<?php
include "koneksi.php";
$id=$_GET['id'];
$query = mysqli_query($dbconnect, "SELECT * FROM siswa where id='$id'")
   or die (mysqli_error($dbconnect));
?>
<h1 alignment"center">EDIT DATA</h1>
<form action="skripupdate.php" method="post">
<table border="0" align="center">
<?php
while ($row = mysqli_fetch_array($query)){
?>
<input type="hidden" name="id" value="<?php echo "{$row['id']}";?>"/>
<tr>
<td>ID</td><td><input type="text" name="id" maxlength="3" size="3" value="<?php echo "{$row['id']}";?>" /></td>
</tr>
<tr>
<td>Nama</td><td><input type="text" name="nama" maxlength="25" size="25" value="<?php echo "{$row['nama']}";?>" /></td>
</tr>
<tr>
<td>Alamat</td><td><input type="text" name="alamat" maxlength="50" size="50" value="<?php echo "{$row['alamat']}";?>" /></td>
</tr>
<tr>
<td>tahun</td><td><input type="text" name="tahun" maxlength="4" size="4" value="<?php echo "{$row['tahun']}";?>" /></td>
</tr>
<tr>
<td>kelas</td><td><input type="text" name="kelas" maxlength="3" size="3" value="<?php echo "{$row['kelas']}";?>" /></td>
</tr>
<tr>
<td>rombel</td><td><input type="text" name="rombel" maxlength="1" size="1" value="<?php echo "{$row['rombel']}";?>" /></td>
</tr>

<tr><td></td><td align="center"><input type="submit" value="Simpan" name="simpan" /></td>
</tr>
<?php
}
?>
</table>
</form>
       <?php
            include "tglskg.php";
       ?>
</body>
</html>

Tidak ada komentar:

Posting Komentar

Komentarlah dengan bijak no Spam