Page 355 - SK tingkatan 5
P. 355
Senarai.php
<html>
<head>
<title>Papar Rekod</title>
</head>
<body>
<?php
$nomurid = $_POST['nomurid'];
$con = mysqli_connect("localhost","root","");
if (!$con)
{
die('Sambungan kepada Pangkalan Data Gagal'
.mysqli_connect_error());
}
mysqli_select_db($con,"dbPelajar");
$hasil = mysqli_query($con,"SELECT * FROM MURID WHERE
NOMURID ='".$nomurid."'");
$row = mysqli_fetch_array($hasil);
$nama = htmlspecialchars($row['NAMA'],ENT_QUOTES);
$kelas = $row['KELAS'];
$negeri=$row['NEGERILAHIR'];
?>
<form action = "Cari.php" method ="">
<p>No Murid<input name = "nomurid" readonly
value = "<?php print$nomurid;?> " type = "text" size = "10"></p>
<p>Nama Murid <input name = "nama" readonly type="text"
value = "<?php print $nama;?>">
</p>
<p>Kelas<input name = "kelas" readonly type = "text" size = "15"
value = "<?php print $kelas; ?>"> </p>
<p>Negeri Kelahiran <input name = "negeri" readonly type = "text"
size = "20" value = "<?php print $negeri;?>">
</p>
<p><input Type = "submit" Name = "submit" Value = "Kembali"></p>
</form>
</body>
</html>
Rajah 3.3.83(b) Atur cara bagi “Senarai.php”
BAB 3 Pengaturcaraan Berasaskan Web 347

