Gambar Tidak Tampil (Blank)

permisi mas saya mau bertanya. kemaren saya membuat sebuah halaman dimana pada halaman tersebut harus dapat menampilkan foto. tetapi setelah saya coba koding fotonya tidak tampil nnamun ketika di inspect data sudah masuk. mohon pencerahannya mas-mas sekalian

terima kasih

berikut kode program dan tampilan halaman

 <?php
if(isset($_GET['p'])){
	$p = $_GET['p'];
} else $p = 1;
//----------------
$username=$_SESSION['username'];
$kueri = "select * from akun where username = '$username'";
$jalan = mysqli_query($connect, $kueri);
$hasil = mysqli_fetch_array($jalan);
$id_akun = $hasil['id_akun'];

$query = "select * from data_penghuni where id_akun = '$id_akun' order by date DESC";
$sql_b = mysqli_query($connect, $query);
$jum_data = mysqli_num_rows($sql_b);

//------------------menampilkan form isi data

?>

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="description" content="">
<meta name="author" content="">
<title>Sistem Informasi Asrama Mahasiswa Politeknik Negeri Batam</title>
<link href="css/bootstrap.min.css" rel="stylesheet">
<link href="css/font-awesome.min.css" rel="stylesheet">
<link href="css/animate.min.css" rel="stylesheet">
<link href="css/prettyPhoto.css" rel="stylesheet">
<link href="css/main.css" rel="stylesheet">
<link href="css/style.css" rel="stylesheet">
<link href="css/responsive.css" rel="stylesheet">
<link href="css/swiper.min.css" rel="stylesheet">
<!--[if lt IE 9]>
<script src="js/html5shiv.js"></script>
<script src="js/respond.min.js"></script>
<![endif]-->
<link rel="shortcut icon" href="images/favicon1.png">
<link rel="apple-touch-icon-precomposed" sizes="144x144" href="images/ico/apple-touch-icon-144-precomposed.png">
<link rel="apple-touch-icon-precomposed" sizes="114x114" href="images/ico/apple-touch-icon-114-precomposed.png">
<link rel="apple-touch-icon-precomposed" sizes="72x72" href="images/ico/apple-touch-icon-72-precomposed.png">
<link rel="apple-touch-icon-precomposed" href="images/ico/apple-touch-icon-57-precomposed.png">

<script src="js/jquery.js"></script>
<script src="js/basic-jquery-slider.js"></script>
<script src="js/bootstrap.min.js"></script>
<script src="js/jquery.prettyPhoto.js"></script>
<script src="js/jquery.isotope.min.js"></script>
<script src="js/main.js"></script>
<script src="js/wow.min.js"></script>
</head>
<body class="homepage">
<?php
while($data = mysqli_fetch_array($sql_b)){
	$id_penghuni = $data['id_penghuni'];

?>

<div>
<h2 style="margin-top:10px;color:#666666;text-align:center;margin:20px;">Data Diri - <?php echo $data['nama_lengkap']; ?></h2>
</div>
<div class="container">
	<div class="row">

	<a href="?page=update-dataDiri&id_penghuni=<?php echo $data['id_penghuni']."@".$p; ?>" class="btn btn-success">Ubah Data</a>

		<div class="col-group">
			<label class="col-sm-3 control-label" ><font size="3.5"><b>ID Penghuni </font><label style="color: red;"></label></b></label>
			<div class="col-sm-9"><input class="form-control" type="text" name="id_penghuni" value="<?php echo $data['id_penghuni'] ?>" disabled /></div>
		</div>
		<div class="col-xs-offset-0 col-md-9">
			<table class="table table-bordered"  style="height:100px;width:100%;">
				<tr align="center">
					<font size="4"><b>A. Identitas Pribadi</font>
				</tr><br><br>
				<tr>
					<th>Nama Lengkap</th><td><?php echo $data['nama_lengkap']; ?></td>
				</tr>
				<tr>
					<th>Jenis Kelamin</th><td><?php echo $data['jenis_kelamin']; ?></td>
				</tr>
				<tr>
					<th>NIM</th><td><?php echo $data['NIM']; ?></td>
				</tr>
				<tr>
					<th>TTL</th><td><?php echo $data['TTL']; ?></td>
				</tr>
				<tr>
					<th>Alamat Asal</th><td><?php echo $data['alamat_asal']; ?></td>
				</tr>
				<tr>
					<th>Kode Pos</th><td><?php echo $data['kodepos_asal']; ?></td>
				</tr>
				<tr>
					<th>Alamat Batam</th><td><?php echo $data['alamat_batam']; ?></td>
				</tr>
				<tr>
					<th>Kode Pos</th><td><?php echo $data['kodepos_batam']; ?></td>
				</tr>
				<tr>
					<th>No Telp</th><td><?php echo $data['notelp']; ?></td>
				</tr>
			</table>
		</div>

	<!--Menampilkan Foto -->

		<div class="col-sm-9 col-md-3"><br><br>
			<div class="thumbnail" style="height:320px">
				<?php
					$query = "select * from gambar_datapenghuni WHERE id_penghuni = '$id_penghuni'";
					$sql = mysqli_query($connect, $query);
					if(mysqli_num_rows($sql)>0){
						$photo = "";
				?>
				<div class="swiper-container gallery-top">
					<div class="swiper-wrapper">
						<?php while($x = mysqli_fetch_array($sql)){ ?>
						<div class="swiper-slide" style="background-image:url(<?php echo $x['url'] ?>)"></div>
						<?php }; ?>
					</div>
				</div>
				<?php
					} else {
						$photo = "<h2 align='center'><em>Foto tidak tersedia</em></h2>";
					}
				echo $photo;
				?>
			</div>
		</div>

		<!-- End -->

		<div class="col-xs-offset-0 col-md-12">
			<table class="table table-bordered"  style="height:100px;width:100%;">
				<tr align="center">
					<font size="4"><b>B. Identitas Wali/Saudara</font>
				</tr><br><br>
				<tr>
					<th width="18.3%">Nama Lengkap</th><td><?php echo $data['nama_wali']; ?></td>
				</tr>
				<tr>
					<th>Alamat</th><td><?php echo $data['alamat_wali']; ?></td>
				</tr>
				<tr>
					<th>kode Pos</th><td><?php echo $data['kodepos_wali']; ?></td>
				</tr>
				<tr>
					<th>No Telp</th><td><?php echo $data['notelp_wali']; ?></td>
				</tr>
				<tr>
					<th>Pekerjaan</th><td><?php echo $data['pekerjaan_wali']; ?></td>
				</tr>
			</table>
		</div>
		<div class="col-xs-offset-0 col-md-12">
			<table class="table table-bordered"  style="height:100px;width:100%;">
				<tr align="center">
					<font size="4"><b>C. Identitas Orang Tua</font>
				</tr><br><br>
				<tr>
					<th width="18.3%">Nama Ayah</th><td><?php echo $data['nama_ayah']; ?></td>
				</tr>
				<tr>
					<th>Nama Ibu</th><td><?php echo $data['nama_ibu']; ?></td>
				</tr>
				<tr>
					<th>Alamat</th><td><?php echo $data['alamat_ortu']; ?></td>
				</tr>
				<tr>
					<th>kode Pos</th><td><?php echo $data['kodepos_ortu']; ?></td>
				</tr>
				<tr>
					<th>No Telp</th><td><?php echo $data['notelp_ortu']; ?></td>
				</tr>
				<tr>
					<th>Pekerjaan</th><td><?php echo $data['pekerjaan_ortu']; ?></td>
				</tr>
				<tr>
					<th>Pedapatan</th><td><?php echo $data['pendapatan_ortu']; ?></td>
				</tr>
			</table>
		</div>
	</div>
</div>
</div>
</body>
</html>
<div class="container" align="center" style="margin-top:10px; margin-bottom:50px;">

</div>
<?php }

?>

avatar Ripon
@Ripon

9 Kontribusi 0 Poin

Diperbarui 5 tahun yang lalu

3 Jawaban:

coba ini, tambah kutip <pre> &lt;div class="swiper-slide" style="background-image:url('&lt;?php echo $x['url'] ?&gt;')"&gt;&lt;/div&gt; </pre>

avatar dianarifr
@dianarifr

642 Kontribusi 316 Poin

Dipost 5 tahun yang lalu

tidak ada perubahan mas

avatar Ripon
@Ripon

9 Kontribusi 0 Poin

Dipost 5 tahun yang lalu

direktori gambar sudah benar?

avatar dianarifr
@dianarifr

642 Kontribusi 316 Poin

Dipost 5 tahun yang lalu

Login untuk ikut Jawaban