foto siswa part II

Iwan · May 28, 2012
mas .. kmrn script yg pyn kc uda q coba ... n berhasil..
tp stlah q proses , tidak muncul fotonya mas ... tp cuma mncul nama ftonya ja,,
misal : "aku.jpg" ja mas ,,,

pa nya ea mas????
Silahkan login untuk menjawab!
0
Loading...
Ellyx Christian · May 29, 2012 · 0 Suka · 0 Tidak Suka
bisa lihat kode kamu untuk menampilkannnya?
0
Loading...
Iwan · May 31, 2012 · 0 Suka · 0 Tidak Suka
ini mas codenya...


tampil_siswa.php
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Untitled Document</title>
</head>

<body>

  <h3 align="center">DATA SISWA</h3>
<table width="800" border="2" align="center" cellpadding="2" cellspacing="2">
<tr>
<td align="center" bgcolor="#CCCCCC">NIS</td>
<td align="center" bgcolor="#CCCCCC">NAMA</td>
<td align="center" bgcolor="#CCCCCC">KELAS</td>
<td align="center" bgcolor="#CCCCCC">JURUSAN</td>
<td align="center" bgcolor="#CCCCCC">FOTO</td>
</tr>
</form>
<?php
//koneksi ke database
include("koneksi.php");
//membuka database data_siswa
mysql_select_db("data_siswa");
$a="select*from tabel_siswa order by nis";
$b=mysql_query($a);
while($c=mysql_fetch_row($b)){
echo"
<tr>
<td>$c[1]</td>
<td>$c[2]</td>
<td>$c[3]</td>
<td>$c[4]</td>
<td>$c[5]</td>
</tr>";}
?>
</table>
<div align="center">
 </form>
	<p><a href="form_siswa.php">Tambah Data</a>\<a href="edit_siswa.php">Edit Data</a>\<a href="hapus_siswa.php">Hapus Data</a></p>
	</div>
</body>

</html>


pa perlu d kc java script mas ?? tlong d bnerin ea mas code q
thanks...
sukses bwt mas ellyx
0
Loading...
Ellyx Christian · May 31, 2012 · 0 Suka · 0 Tidak Suka
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Untitled Document</title>
</head>
 
<body>
 
  <h3 align="center">DATA SISWA</h3>
<table width="800" border="2" align="center" cellpadding="2" cellspacing="2">
<tr>
<td align="center" bgcolor="#CCCCCC">NIS</td>
<td align="center" bgcolor="#CCCCCC">NAMA</td>
<td align="center" bgcolor="#CCCCCC">KELAS</td>
<td align="center" bgcolor="#CCCCCC">JURUSAN</td>
<td align="center" bgcolor="#CCCCCC">FOTO</td>
</tr>
</form>
<?php
//koneksi ke database
include("koneksi.php");
//membuka database data_siswa
mysql_select_db("data_siswa");
$a="select*from tabel_siswa order by nis";
$b=mysql_query($a);
while($c=mysql_fetch_row($b)){
echo'
<tr>
<td>'.$c[1].'</td>
<td>'.$c[2].'</td>
<td>'.$c[3].'</td>
<td>'.$c[4].'</td>
<td><img src="foto/'.$c[5].'"/></td> <!-- jika gambar disimpan di folder foto -->
</tr>';
}
?>
</table>
<div align="center">
 </form>
	<p><a href="form_siswa.php">Tambah Data</a>\<a href="edit_siswa.php">Edit Data</a>\<a href="hapus_siswa.php">Hapus Data</a></p>
	</div>
</body>
 
</html>
0
Loading...
Iwan · Jun 2, 2012 · 0 Suka · 0 Tidak Suka
thanks ea mas ,, ftonya da berhasil mas....
tp ada msalah lg mas....

wktu q liat di tampil_siswa.php .... ukuran ftonya besar banget mas ,, gmn cranya ngecilin ukuran fto itu... mwnya q, sperti ukuran fto yg 3X4 atw 4X6 j mas

thanks mas sblumnya
0
Loading...
Ellyx Christian · Jun 2, 2012 · 0 Suka · 0 Tidak Suka
tambahkan saja attribute width di gambarnya seperti <img src="foto/'.$c[5].'" width="200"/>