Advertisement
cdsatrian

website title

Sep 16th, 2012
75
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.89 KB | None | 0 0
  1. <?php
  2. $modul=isset($_GET['modul'])?$_GET['modul']:'';
  3. $id=isset($_GET['id'])?$_GET['id']:'';
  4. switch ($modul) {
  5.    case 1:
  6.          $sql="SELECT jdl_gallery AS title FROM gallery WHERE id_gallery='$id'";
  7.          break;
  8.    case 2:
  9.          $sql="SELECT judul AS title FROM berita WHERE id_berita='$id'";
  10.          break;
  11.    case 3:
  12.          $sql="SELECT judul_topik AS title FROM topik_forum WHERE id_topik='$id'";
  13.          break;
  14.    case 4:
  15.          $sql="SELECT nama_member AS title FROM member WHERE id_member='$id'";
  16.          break;
  17.    case 5:
  18.          $sql="SELECT nama_kategori AS title FROM kategori WHERE id_kategori='$id'";
  19.          break;                  
  20.    case 6:
  21.          $sql="SELECT jdl_album AS title FROM album WHERE id_album='$id'";
  22.          break;                  
  23. }
  24. if(isset($sql)){
  25.   $r=mysql_fetch_object($sql);
  26. }
  27. echo isset($r->title)?$r->title:"Title Default";
  28. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement