1 / 3

MODUL 10 SiBEROL: HALAMAN WARTAWAN & REDAKTUR

MODUL 10 SiBEROL: HALAMAN WARTAWAN & REDAKTUR Pada akhir bagian 1 telah dijelaskan bagaimana membuat halaman untuk wartawan. Bila wartawan telah mengisi berita, halaman submitnews.php akan menyimpan berita. submitnews.php Listing halaman untuk menyimpan berita: <html> <head>

joelle
Download Presentation

MODUL 10 SiBEROL: HALAMAN WARTAWAN & REDAKTUR

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. MODUL 10 SiBEROL: HALAMAN WARTAWAN & REDAKTUR Pada akhir bagian 1 telah dijelaskan bagaimana membuat halaman untuk wartawan. Bila wartawan telah mengisi berita, halaman submitnews.php akan menyimpan berita. submitnews.php Listing halaman untuk menyimpan berita: <html> <head> <title>Submit Berita</title> </head> <body> <h2>PROSES SUBMIT BERITA 1</h2><br> <? //Bila tanggal, mulaitay, dan expired //tdk di-generate MySQL, gunakan //ketiga baris ini... $tgl = date("Y-m-d H:i:s"); $mulai = date("Y-m-d H:i:s"); date("s"), $exp = date("Y-m-d H:i:s", mktime(date("H"), date("i"), date("m"), date("d")+7, date("Y"))); $nmWar = $txtNamWar; $judul = $txtJudul; = $txtIsi; $isi mysql_connect("localhost","","") or die ("Ga konek"); mysql_select_db("db_aaa") or die ("DB ga konek"); Raka Yusuf: Pemrograman Berbasis Web 2 (Modul 10) #1/10 http://www.mercubuana.ac.id

  2. Halaman redaktur terdiri dari 3 halaman: untuk melihat berita yang masuk, mereview, dan halaman untuk menyimpan berita. redaktur.php Halaman ini hanyalah modifikasi dari halaman index.php. Hanya saja yang ditampilkan yang field layak berisi nilai 0. Listingnya adalah: <html> <head> <title>Halaman Redaktur</title> </head> <body> <h1> BERITA YANG MASUK</h1> <?php // database yang digunakan: db_aaa // tabel yang digunakan: berita mysql_connect("localhost","","") or die ("Ga konek"); mysql_select_db("db_aaa") or die ("DB ga konek"); $perintah="SELECT * FROM berita WHERE layak=0"; $hasil=mysql_query($perintah); while($row=mysql_fetch_array($hasil)) { $brief=substr($row[isi], 0, 120)."..."; echo "<table border=0>\n"; echo " <tr><td colspan=2 width=300><h3>$row[judul]</h3></td></tr>\n"; " width=150>Oleh: echo <tr><td width=150>$row[tanggal]</td><td <b>$row[namwar]</b></td></tr>\n"; echo " <tr><td colspan=2 width=300>$brief</td></tr>\n"; echo " <tr><td align=right><a colspan=2 width=300 href=reviewnews.php?id=$row[id]>Review Berita Ini</a></td></tr>\n"; echo "</table>\n<br>\n"; } Raka Yusuf: Pemrograman Berbasis Web 2 (Modul 10) #3/10 http://www.mercubuana.ac.id

  3. <title>HALAMAN REVIEW</title> </head> <body> <h2>REVIEW BERITA</h2><br> <br> <?php // database yang digunakan: db_aaa // tabel yang digunakan: berita mysql_connect("localhost","","") or die ("Ga konek"); mysql_select_db("db_aaa") or die ("DB ga konek"); $perintah="SELECT * FROM berita WHERE id=$id"; $hasil=mysql_query($perintah); while($row=mysql_fetch_array($hasil)) { $tanggal=$row[tanggal]; $judul=$row[judul]; $namwar=$row[namwar]; $isi=$row[isi]; $mulaitay=$row[mulaitay]; $expired=$row[expired]; $layak=$row[layak]; } ?> <form method=post action=editnews.php> style="border- <table border="0" cellpadding="0" cellspacing="0" collapse: collapse" width="100%" bordercolor="#111111" id="AutoNumber1"> <tr> <td width="20%">ID berita</td> <td width="4%">:</td> <td width="76%"><? echo $id; ?></td> </tr> <tr> <td width="20%">Tanggal Submit</td> Raka Yusuf: Pemrograman Berbasis Web 2 (Modul 10) #5/10 http://www.mercubuana.ac.id

More Related