You are on page 1of 5

<?

php
$db_name = "cheesecinema";
$table_name = "member";
$connection = @mysql_connect("localhost", "","")
or die(mysql_error());
$db = @mysql_select_db($db_name, $connection) or
die(mysql_error());
$sql = "select id, nama, alamat,
?>

Masuk_akun.php
<?php
session_name("cheesecinema");
session_start();
session_unset();
session_destroy();
session_register("email");
$link = mysql_connect("localhost", "root", "") or die("Could not connect to localhost");
mysql_select_db("cheesecinema") or die("Tidak dapat terkoneksi dengan database
cheesecinema");
if (isset( $_POST['email']) && isset( $_POST['password'])) {
$email = $_POST['email'];
$password = $_POST['password'];
$query = "SELECT * FROM member WHERE email='$email' AND
password='$password'";
$result = mysql_query($query) or die("Query failed");
$line = mysql_fetch_array($result, MYSQL_ASSOC);
if ($line) {
$_SESSION['email'] = $line[email];
session_write_close();
echo "<script>document.location.href='akun.php';</script>\n";
exit();
} else {
$_SESSION['email'] = "";
session_write_close();
echo "<script>alert('Anda tidak terdaftar atau password salah!');
document.location.href='akun.php';</script>\n";
exit();
}
} else {
?>
<html>
<head>

<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">


<title>Cheese Cinema | Masuk Akun</title>
<style type="text/css">
<!-.style5 {font-family: Geneva, Arial, Helvetica, sans-serif}
-->
</style></head>
<body>
<table width="980" border="1" bgcolor="#CCCCFF">
<tr>
<td width="970" bordercolor="#6699FF"><div align="center"><img src="image/head.gif"
width="944" height="196"></div></td>
</tr>
</table>
<table width="978" border="1" bgcolor="#CCCCFF">
<tr bordercolor="#6699FF">
<td width="153"><a href="index.php"><img src="image/HOMEE.GIF" width="153"
height="60" border="0"></a></td>
<td width="153"><a href="movie.php"><img src="image/MOVIE.GIF" width="153"
height="60" border="0"></a></td>
<td width="153"><a href="news.php"><img src="image/NEWS.GIF" width="153"
height="60" border="0"></a></td>
<td width="153"><a href="about.php"><img src="image/ABOUT.GIF" width="153"
height="60" border="0"></a></td>
<td width="153"><a href="contact.php"><img src="image/CONTACT.GIF" width="153"
height="60" border="0"></a></td>
<td width="194"><table width="175" border="1" bordercolor="#CCCCFF"
bgcolor="#CCCCFF">
<tr>
<td width="165" bordercolor="#6699FF"><div align="center"><a
href="daftar_anggota.php"><img src="image/DAFTARANGGOTA.GIF" width="165"
height="30" border="0"></a></div></td>
</tr>
<tr>
<td bordercolor="#6699FF"><a href="masuk_akun.php"><img
src="image/MASUKAKUN.GIF" width="165" height="30" border="0"></a></td>
</tr>
</table></td>
</tr>
</table>
<table width="980" border="1" bordercolor="#6699FF" bgcolor="#CCCCFF">
<tr bordercolor="#6699FF" bgcolor="#6699FF">
<td width="993" bgcolor="#CCCCFF"><table width="765" border="1" align="center">
<tr>

<td><img src="image/MASUKAKUN2.GIF" width="950" height="30"></td>


</tr>
</table>
<p class="style5"><span class="style5">Masukkan Akun Anda</span>:</p>
<table border='0' width='50%' cellpadding = '3'
cellspacing = '3'
align = 'center'>
<form method="post" action="akun.php">
<tr><td><b><span class="style5">E-mail</span></b></td><td><input type="text"
name="email"/></td></tr>
<tr><td><b><span class="style5">Password</span></b></td><td><input
type="password" name="password"/></td></tr>
<tr><td></td><td><input type="submit" value="Login"/></td></tr>
</table>
</table>
<table width="977" border="1" bordercolor="#6699FF" bgcolor="#CCCCFF">
<tr>
<td width="989" bordercolor="#9999FF" bgcolor="#CCCCFF"><img src="image/footer.gif"
width="969" height="100"></td>
</tr>
</table>
<p>&nbsp;</p>
</body>
</html>
<?php
}
?>
Akun.php
<?php
include "koneksi.php";
?>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title>Cheese Cinema | Akun Anda</title>
<style type="text/css">
<!-.style5 {
font-family: Geneva, Arial, Helvetica, sans-serif;
font-weight: bold;
}
.style9 {
font-family: Geneva, Arial, Helvetica, sans-serif;
font-size: 12px;
}

-->
</style></head>
<body>
<table width="980" border="1" bgcolor="#CCCCFF">
<tr>
<td width="970" bordercolor="#6699FF"><div align="center"><img src="image/head.gif"
width="944" height="196"></div></td>
</tr>
</table>
<table width="980" border="1" bgcolor="#CCCCFF">
<tr bordercolor="#6699FF">
<td width="153" height="80"><a href="index.php"><img src="image/HOMEE.GIF"
width="153" height="60" border="0"></a></td>
<td width="153"><a href="movie.php"><img src="image/MOVIE.GIF" width="153"
height="60" border="0"></a></td>
<td width="153"><a href="news.php"><img src="image/NEWS.GIF" width="153"
height="60" border="0"></a></td>
<td width="153"><a href="about.php"><img src="image/ABOUT.GIF" width="153"
height="60" border="0"></a></td>
<td width="153"><a href="contact.php"><img src="image/CONTACT.GIF" width="153"
height="60" border="0"></a></td>
<td width="175"><table width="175" border="1" bordercolor="#CCCCFF"
bgcolor="#CCCCFF">
<tr>
<td width="165" height="34" bordercolor="#6699FF"><div align="center"><a
href="daftar_anggota.php"><img src="image/DAFTARANGGOTA.GIF" width="165"
height="30" border="0"></a></div></td>
</tr>
<tr>
<td bordercolor="#6699FF"><a href="masuk_akun.php"><img
src="image/MASUKAKUN.GIF" width="165" height="30" border="0"></a></td>
</tr>
</table></td>
</tr>
</table>
<table width="979" border="1" bordercolor="#6699FF" bgcolor="#CCCCFF">
<tr bordercolor="#6699FF" bgcolor="#6699FF">
<td width="785" bgcolor="#CCCCFF"><table width="765" border="1" align="center">
<tr>
<td><img src="image/AKUNANDA2.GIF" width="950" height="30"></td>
</tr>
</table>
<h3 align="justify">Data Akun Anda :</h3>
<?
$sql = "SELECT * FROM member";

$hasil = mysql_query($sql);
$total = mysql_num_rows($hasil);
echo "<br>";
echo "<table align='center' border='1'>";
echo
"<tr><th>Id Member</th><th>Nama</th><th>Alamat</th><th>Kota</th><th>No.
Telp/Hp</th><th>E-mail</th><th>Nilai Deposit</th></tr>";
while ($data=mysql_fetch_array($hasil)) {
echo "<tr><td>$data[idmember]</td>";
echo "<td>$data[nama]</td>";
echo "<td>$data[alamat]</td>";
echo "<td>$data[kota]</td>";
echo "<td>$data[notelp]</td>";
echo "<td>$data[email]</td>";
echo "<td>$data[nilaideposit]</td></tr>";
}
echo "</table>";
echo "<p>Jumlah Member: <b>$total</b></p>";
?>
<table width="977" border="1" bordercolor="#6699FF" bgcolor="#CCCCFF">
<tr>
<td width="989" bordercolor="#9999FF" bgcolor="#CCCCFF"><img src="image/footer.gif"
width="969" height="100"></td>
</tr>
</table>
<p>&nbsp;</p>
</body>
</html>
<?php $query = mysql_query("SELECT * FROM user"); ?>
<div class="username">Menu Artikel</div>
<?php while ($data = mysql_fetch_array($query)) { ?>
<a href="akun.php?id=<?php echo $data['id'] ?>"> <?php echo $data['username']; ?></a><br />

You might also like