kakak2... saya mau tanya tentang php (saya pemula sekali)
begini gmna script php buat nampilin foto profile tanpa membuat tabel didatabase terlebih dahulu(didatabse hanya ada tabel data) tetapi melalui folder kak. jadi begini... misalkan : saya punya folder image namanya "friends". saya ingin menampilkan data dan menampilkan fotonya sesuai datanya(ex : data ani --> foto ani, data andi --> foto andi). jadi ketika teman saya andi login (username dan password) --> tampil data dan foto andi. ketika ani login(username dan password) --> tampil data ani dan foto ani. mohon bantuannya...

thanks...
veetha
Silahkan login untuk menjawab!
0
Loading...
Ellyx Christian · Jul 20, 2011 · 0 Suka · 0 Tidak Suka
kamu bisa kasi tahu bagaimana cara kamu menampilkan data user (kodingnya)?
0
Loading...
veetha · Jul 21, 2011 · 0 Suka · 0 Tidak Suka
kak ini script phpnya...
maunya disebalah kiri itu muncul foto kayak fb gitu kak..
===========================
<?php
SESSION_START();

if(ISSET($_SESSION)) {

$username= $_SESSION;
?>

<!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=utf-8" />
<title> Profile Pengurus</title>
<meta name="keywords" content="" />
<meta name="description" content="" />
<link href="styles.css" rel="stylesheet" type="text/css" />
<style type="text/css">
<!--
.style5 {font-size: 14px}
.style6 {color: #000000}
.style8 {
color: #000000;
font-size: 12;
font-weight: bold;
}
.style9 {
color: #C60004;
font-size: 14px;
}
.style10 {color: #C60004}
.style12 {color: #666666}
-->
</style>
</head>
<body>


<div id="wrapper">
<div id="wrap">
<!-- header begins -->
<!-- header ends -->
<!-- content begins -->
<div id="content">
<div id="left">
<?php
$koneksi=mysql_connect('localhost','root','');
$db=mysql_select_db('comite',$koneksi);
$q="SELECT * FROM pengurus where pengurus.nim = '$username'";
$hasil=mysql_query($q);
$data = mysql_fetch_array($hasil);


?>
<span class="style12"></span>
<h2>Profile</h2>
<div class="inner">
<p></p>
<div id="description0-essay-full">
<form action="edit.php" method="post">
<table width="432" height="510" border="4">
<tr>
<td width="74">Nama</td>
<td width="8">:</td>
<td width="266"><label>
<input name="nama" readonly="readonly" type="text" value="<?php echo $data ?>" border="1" />
</label></td>
</tr>
<tr>
<td>Nim</td>
<td>:</td>
<td><label>
<input type="text" readonly="readonly" name="nim" value="<?php echo $data ?>" />
</label></td>
</tr>
<tr>
<td>TTL</td>
<td>:</td>
<td><label>
<input type="text" readonly="readonly" name="ttl" value="<?php echo $data ?>"/>
</label></td>
</tr>
<tr>
<td>Email</td>
<td>:</td>
<td><label>
<input type="text" readonly="readonly" name="email" value="<?php echo $data ?>" />
</label></td>
</tr>
<tr>
<td>Alamat</td>
<td>:</td>
<td><label>
<input tabindex="12" type="text" readonly="readonly" name="alamat" value="<?php echo $data ?>" />
</label></td>
</tr>
<tr>
<td>Agama</td>
<td>:</td>
<td><label>
<input type="text" readonly="readonly" name="agama" value="<?php echo $data ?>" />
</label></td>
</tr>
<tr>
<td>No. Telp </td>
<td>:</td>
<td><label>
<input type="text" readonly="readonly" name="hp" value="<?php echo $data ?>" />
</label></td>
</tr>
<tr>
<td>Jabatan</td>
<td>:</td>
<td><label>
<input type="text" readonly="readonly" name="email" value="<?php echo $data ?>" />
</label></td>
</tr>
<tr>
<td>Departement</td>
<td>:</td>
<td><label>
<input type="text"readonly="readonly" name="email" value="<?php echo $data ?>" />
</label></td>
</tr>
<tr>
<td>Jurusan</td>
<td>:</td>
<td><label>
<input name="text" type="text"" value="<?php echo $data ?>"readonly="readonly name="email />
</label></td>
</tr>
<tr> <br />
<br />
<br />
</tr>
<tr>
<td></td>
<td></td>
</tr>
<tr>
<td colspan="3"><input type='submit' name="submit" value="Edit" /></td>
</tr>
</table>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
</form>
</div>
</div>
<h2>&nbsp;</h2>
<br />
<div style="clear: both"></div>
</div><br />
<!-- content ends -->
<!-- footer begins -->
<div id="footer">
Copyright 2011. Design by <a href="http://www.electrictowelrail.org.uk/" target="_blank">ETR</a><br />
<a href="#">Privacy Policy</a> | <a href="#">Terms of Use</a> | <a href="http://validator.w3.org/check/referer" title="This page validates as XHTML 1.0 Transitional"><abbr title="eXtensible HyperText Markup Language">XHTML</abbr></a> | <a href="http://jigsaw.w3.org/css-validator/check/referer" title="This page validates as CSS"><abbr title="Cascading Style Sheets">CSS</abbr></a></div>
<!-- footer ends -->
</div>
</div>
</div><?php } else {
echo "gagal";
}


?>
</body>
</html>
==========================================
jadi gmna kak?/
thanks...
veetha
2
Loading...
Ellyx Christian · Jul 21, 2011 · 2 Suka · 0 Tidak Suka
nama fotonya sama dengan username ya? jika iya tinggal pake seperti:
echo '<img src="friends/'.$_SESSION['username'].'.jpg"/>';
kamu juga bisa gunakan konsep yang ada di http://www.myphptutorials.com/tutorials/39/membuat-galeri-foto
0
Loading...
veetha · Jul 21, 2011 · 0 Suka · 0 Tidak Suka
iya.kak nama foto=nama username...kak folderny taruh dmana?
0
Loading...
Ellyx Christian · Jul 21, 2011 · 0 Suka · 0 Tidak Suka
folder ditaruh sejajar dengan file untuk menampilkan gambar.
0
Loading...
veetha · Jul 21, 2011 · 0 Suka · 0 Tidak Suka
ok kak makasich kak...