1 回答
TA贡献1865条经验 获得超7个赞
该session_start()功能必须是文档中的第一件事。在任何 HTML 标记之前。
<?php
session_start();
?>
<!doctype html>
<html>
<head>
<title>Untitled Document</title>
<?php include 'connection.php'; ?>
</head>
<body>
<form action="index.php" method="get">
<label> Cari :</label>
<input type="text" name="cari">
<input type="submit" value="cari">
</form>
<?php
//search norek
if(isset($_GET['cari']))
{
$cari = $_GET['cari'];
echo "<b>Hasil Pencarian : ".$cari."</b>";
}
?>
<table width="600" border="1">
<?php
if(isset($_GET['cari']))
{
$cari = $_GET['cari'];
$dato = mysqli_query($connect, "
SELECT
*
FROM
faskes
INNER JOIN pemilik_rekening USING ( norek )
INNER JOIN transaksi USING ( kode_faskes )
WHERE transaksi.norek LIKE
'%".$cari."%'
");
} else {
$dato = mysqli_query($connect, "
SELECT
*
FROM
faskes
INNER JOIN pemilik_rekening USING ( norek )
INNER JOIN transaksi USING ( kode_faskes )
");
}
$no = 1;
while($d = mysqli_fetch_array($dato))
{
?>
<tr>
<td><?php echo $no++; ?></td>
<td><?php echo $d['kode_faskes']; ?></td>
<td><?php echo $d['nama_faskes']; ?></td>
<td><?php echo $d['alamat_faskes']; ?></td>
<td><?php echo $d['norek']; ?></td>
<td><?php echo $d['pemegang_norek']; ?></td>
<td><?php echo $d['tanggal_bayar']; ?></td>
<td><?php echo $d['jumlah_bayar']; ?></td>
</tr>
<?php
$_SESSION['cari'] = $cari;
$_SESSION['kode_faskes'] = $d['kode_faskes'];
}
?>
</table>
</body>
</html>
- 1 回答
- 0 关注
- 83 浏览
添加回答
举报