arsiarne

Untitled

Apr 16th, 2014
90
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.09 KB | None | 0 0
  1. <?php
  2. if (isset($_POST['submit'])){
  3. $user = $_POST['username'];
  4. $password = $_POST['password'];
  5. $sql = "SELECT * FROM `user` WHERE mnama='$user' OR memail ='$user' AND mpassword= md5('$password') ";
  6. $query = mysql_query($sql);
  7. if(mysql_num_rows($query)>0){
  8. $row = mysql_fetch_row($query);
  9. if($row[9]=="user"){
  10. if($row[8]==1){
  11. $_SESSION['member_id'] = $row[0];
  12. $_SESSION['KCFINDER']=array();
  13. $_SESSION['KCFINDER']['disabled'] = false;
  14. $_SESSION['KCFINDER']['uploadURL'] = "../tinymcpuk/gambar";
  15. $_SESSION['KCFINDER']['uploadDir'] = "";
  16. header('location:user_index.php');
  17. exit;
  18. }elseif($row[8]==0){
  19. $_SESSION['error']="Maaf akun anda tidakaktif";
  20. header('location:index.php?page=login');
  21.  
  22. }
  23. }else{
  24.  
  25. $_SESSION['admin_id'] = $row[0];
  26. $_SESSION['nama'] = $row[1];
  27. header('location:admin_index.php');
  28. exit;
  29. }
  30. }else{
  31. $_SESSION['error']="Username atau Password salah";
  32. header('location:index.php?page=login');
  33. }
  34. }
  35. ?>
Advertisement
Add Comment
Please, Sign In to add comment