A-18
center div
div id=Banner atas marqueeSelamat datang di Auto Zone. Sebuah website informasi mengenai masalah
seputar mobil dan tips-tips seputar mobil, disertai penjualan aksesoris untuk mobil.marqueediv
div id=Headerimg src=Head.jpg width=983 height=192 div div
div id=apDiv1 Selamat Datang di website AutoZone, Anda telah berhasil loginb?
echousername;?b | a href=logout.phpLogouta div
script type=textjavascript --
var MenuBar1 = new Spry.Widget.MenuBarMenuBar1, {imgDown:..SpryAssetsSpryMenuBarDownHover.gif,
imgRight:..SpryAssetsSpryMenuBarRightHover.gif}; --
script body
html
8. Logout.php
?php includekonek.php;
session_start; unset_SESSION[userku];
headerlocation:Index.php; ?
9. List_forum.php
?php includekonek.php;
session_start; username=_SESSION[userku];
if_SESSION[userku]== untuk mencegah apabila halaman diakses tanpa login session kosong, maka otomatis di redirect ke form login index.php
{ ob_start;
A-19
headerlocation:index.php; ob_end_flush;
} ?
style type=textcss --
apDiv1 {
position:absolute; left:0;
right:0; margin-left:auto;
margin-right:auto; width:987px;
height:900px; z-index:1;
top: 17px; left: 11px;
color: FFF; }
a:link { color: F00;
} a:visited {
color: F00; font-weight: bold;
} apDiv2 {
position:absolute; width:160px;
height:34px; z-index:2;
left: 793px; top: 46px;
font-weight: bold; }
-- style
body background=..images 6.jpg div id=apDiv1
font size=+2 ?php
server = localhost; pemakai = root;
password = ; id_mysql = mysql_connectserver, pemakai, password;
db_autozone = mysql_select_dbautozone, id_mysql; Bagian untuk membaca data
sql = SELECT ID_topik, nama, topik FROM forum;
A-20
hasil = mysql_querysql, id_mysql; while baris = mysql_fetch_rowhasil
{ ID_topik = baris[0];
nama = baris[1]; topik = baris[2];
echo br ; echo br ;
echo div style = margin-left: 20px; echo br ;
echo br ; echo nama;
echo br ; echo br ;
echo Pembahasan Topik : topik; echo br ;
echoa href=\tampil_forum.php?ID_topik=ID_topik\Lihatatd\n; echo div;
echo hr; }
echo br ; echo br ;
echo br ; Akhir pembacaan data
mysql_closeid_mysql; ?
font div id=apDiv2b? echousername;?b a
href=logout.phpLogoutadiv font size=+2font
div body
A-21
10. Tampil_forum.php
?php includekonek.php;
session_start; username=_SESSION[userku];
if_SESSION[userku]== untuk mencegah apabila halaman diakses tanpa login session kosong, maka otomatis di redirect ke form login index.php
{ ob_start;
headerlocation:index.php; ob_end_flush;
} ?
?php
server = localhost; pemakai = root;
password = ; id_mysql = mysql_connectserver, pemakai, password;
db_autozone = mysql_select_dbautozone, id_mysql; Bagian untuk membaca data
sql = SELECT ID_topik, nama, topik, isi, foto FROM forum WHERE ID_topik=_GET[ID_topik];
hasil = mysql_querysql, id_mysql; while baris = mysql_fetch_rowhasil
{ ID_topik = baris[0];
nama = baris[1]; topik = baris[2];
isi = baris[3]; foto = baris[4];
echo br ; echo br ;
echo br ; echo br ;
echo br ;
echo div style = margin-left: 20px; echo br ;
echo br ;
A-22
echo nama; echo br ;
echo br ; nilaicounter=counter.txt;
pengunjung=filenilaicounter; pengunjung[0]++;
bukafile=fopennilaicounter,w; fputsbukafile,pengunjung[0];
fclosebukafile; echo Viewed :
pengunjung[0]; echo br ;
echo br ; echo topik : topik;
echo br ; echo br ;
echo isi : isi; echo br ;
echo br ; echo div style = margin-right: 100px;
echo img src= TAfoto_forum.foto. width=150 height=150 align=left ;
echo div; echoa
href=\list_forum.php\brbrbrbrbrbrbrbrBackatd\n; echo div;
echo hr; }
echo br ; echo br ;
echo br ; Akhir pembacaan data
? headtitletitle
style type=textcss --
apDiv1 {
position:absolute; width:200px;
height:48px; z-index:1;
left: 803px; top: 78px;
border:double; }
-- style
head body bgcolor=CCCCCC
?php
A-23
ifisset_GET[pesan]{ echo _GET[pesan];
} ?
form action=proses_comment.php method=POST labelbrbr
Nama: label ?php
id = _SESSION[id]; q = mysql_querySELECT FROM `registercustomer` WHERE `id`=id;
r = mysql_fetch_arrayq; echo r[nama];
? br
input type=hidden name=nama value=?php echo r[nama];? ?php echo rid[username]; ? input type=hidden name=id value=?php echo
rid[username]; ? br br labelKomentar: labelbr
textarea name=comment cols=25 rows=7textarea input type=hidden name=id_topik value=?php echo _GET[ID_topik]; ?
br br br input type=submit name=submit value=Kirim br
form body
?php requirekomentardatabase_konek.php;
id_topik = _GET[ID_topik]; query=mysql_querySELECT FROM `comment` WHERE `ID_TOPIK`=id_topik
ORDER BY id DESC; whilerows=mysql_fetch_assocquery
{ id=rows[id];
dname=rows[name]; dcomment=rows[comment];
echo font color=redName:font . dname . br . br . font color=redComments:font . br . dcomment . nbsp . nbsp .
hr size=5px width=500px color=blue ; }
mysql_closeid_mysql; ?
A-24
11. Tambah_forum.php