justhrun

ujia_1.pehape

Aug 20th, 2014
309
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.74 KB | None | 0 0
  1. <?php
  2.     if(isset($_GET['id'])){    
  3.         $id=$_GET['id'];        
  4.         $is_soal = true;
  5.         $query="select id_soal from tabel_soal where id_soal='$id'";
  6.         $result = mysql_query($query);
  7.         $rows = mysql_num_rows($result);
  8.  
  9.         if($rows!=1) {  // hanya boleh ada 1row
  10.             echo "<script> document.location.href='./home.php?status=Soal belum dibuat!'; </script>";            
  11.         } else {        
  12.             list($id_soal) = mysql_fetch_row($result);            
  13.             mysql_free_result($result);            
  14.             $_SESSION['id_soal']=$id_soal;            
  15.             echo "<script> document.location.href='soal/t_soal.php'; </script>";                            
  16.         }
  17.      }
  18. ?>
Advertisement
Add Comment
Please, Sign In to add comment