Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- $judul = null;
- $author = null;
- $date = null;
- $link = @mysql_connect('127.0.0.1', 'root', '') or die("Gagal menyambung server");
- mysql_set_charset('utf8', $link);
- if(!(@mysql_select_db('cms', $link))){
- $result = "Gagal menyambung database";}
- $query = mysql_query("SELECT * FROM cms;");
- while($hasil = mysql_fetch_array($query)){
- $judul.= "•<a href=".$_SERVER['PHP_SELF']."?id=".$hasil['id'].">".$hasil['judul']."</a><br>";
- }
- if(!isset($_GET['id'])){
- $get = null;
- $row = null;
- $title = null;
- }else{
- $get = abs((int) $_GET['id']);
- $query2 = mysql_query("SELECT * FROM cms WHERE id=$get;");
- while($row = ($cek=@mysql_fetch_array($query2))){
- if(!($get)){
- $content = "Not Found !";
- $title = "Not Found";}else{
- $content = $row['content'];
- $title = $row['judul'];
- $author = $row['author'];
- $date = $row['tanggal'];
- }}
- }
- ?>
- <html>
- <head>
- <meta name="author" content="RieqyNS13">
- <meta http-equiv="Content-type" content="text/html;charset=UTF-8">
- <style type="text/css">
- body, td{
- background-color:#000;
- color:#0F0;
- font-family:"Courier New";
- }
- table#tbl1{
- border:solid #0F0 2px;
- width:200px;
- padding:2;
- text-align:center;
- text-decoration:none;
- length:1000px;
- }
- table#tbl2{
- border:solid #0F0 2px;
- width:1000px;
- text-align:left;
- }
- table td{
- color:#0F0;
- border-spacing:5px;
- font-size:12px;
- text-decoration:none;
- text-align:left;
- }
- a:link{
- color:#060;
- text-decoration:none;
- }
- a:visited{
- color:#060;
- text-decoration:none;
- }
- a:hover{
- color:#060;
- text-decoration:underline;
- }
- a:active{
- color:#060;
- text-decoration:none;
- }
- </style>
- <title><?php echo $title; ?></title>
- </head>
- <body>
- <table id="tbl1">
- <th>Content</th>
- <tr><td><?php echo $judul; ?></td></tr>
- </table>
- <table id="tbl2">
- <tr><td>Author : <?php echo $author; ?></td></tr>
- <tr><td>Tanggal: <?php echo $date; ?></td></tr>
- <tr><td>Content: </td></tr>
- <tr><td><?php echo $content; ?></td></tr>
- </table>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement