Haloo! Selamat Datang di Komunitas Private Training Web Development (46517 Members, 430 Projects, 3577 Topic, 9781 Comments)

Butuh karyawan baru? atau seorang Web Developer (Part-time/Freelance/Full-time), cari disini : Members Area Jobs!
HELP !! error cek_login.php
khairil anwar Mengatakan : Members -
Rate Topic :
  1. <?php
  2. include "config/koneksi.php";
  3. $pass=md5($_POST['password']);
  4. $level=$_POST['level'];
  5. $username = $_POST['id_user'];
  6. if ($level=='Admin')
  7. {
  8. $login=mysql_query("SELECT * FROM rb_users
  9. WHERE email='".mysql_real_escape_string($username)."' AND password='$pass' AND level='$level'");
  10. $cocok=mysql_num_rows($login);
  11. $r=mysql_fetch_array($login);
  12.  
  13. if ($cocok > 0){
  14. session_register("SES_ADMIN");
  15. $_SESSION[id_user] = $r[id_user];
  16. $_SESSION[namauser] = $r[username];
  17. $_SESSION[email] = $r[email];
  18. $_SESSION[namalengkap] = $r[nama_lengkap];
  19. $_SESSION[passuser] = $r[password];
  20. $_SESSION[leveluser] = $r[level];
  21.  
  22. header('location:admin/media.php?module=home');
  23. }
  24. else {
  25. echo "<script>window.alert('Username atau Password anda salah.');
  26. window.location='administrator.php'</script>";
  27. }
  28. }
  29.  
  30. else if ($level=='Member')
  31. {
  32. $login=mysql_query("SELECT * FROM rb_users
  33. WHERE email='".mysql_real_escape_string($username)."' AND password='$pass' AND level='$level'");
  34. $cocok=mysql_num_rows($login);
  35. $r=mysql_fetch_array($login);
  36.  
  37. if ($cocok > 0){
  38. session_register("SES_MEMBER");
  39. $_SESSION[id_user] = $r[id_user];
  40. $_SESSION[passuser] = $r[password];
  41. $_SESSION[namalengkap] = $r[nama_lengkap];
  42. $_SESSION[email] = $r[email];
  43. $_SESSION[telp] = $r[no_telp];
  44. $_SESSION[alamat] = $r[alamat_lengkap];
  45. $_SESSION[umur] = $r[umur];
  46. $_SESSION[leveluser] = $r[level];
  47.  
  48. header('location:member');
  49. }
  50. else {
  51. echo "<script>window.alert('Username atau Password anda salah.');
  52. window.location='login.html'</script>";
  53. }
  54. }
  55.  
  56. ?>
  57.  
  58.  
  59. yang seharusnya gmna kalau php versi if 5.4 > yaa ? mohon infonya
  60. error di bagian
  61.  
  62. Notice: Undefined index: password in C:\xampp\htdocs\pa\cek_login.php on line 4
  63.  
  64. Notice: Undefined index: level in C:\xampp\htdocs\pa\cek_login.php on line 5
  65.  
  66. Notice: Undefined index: id_user in C:\xampp\htdocs\pa\cek_login.php on line 6
Robby Prihandaya Mengatakan :
Admin -
  1. Assalam, disini sudah kita infokan cara untuk mengatasinya mas,.. :)
  2. #https://members.phpmu.com/forum/read/share-banyak-ditemukan-error-pada-beberapa-aplikasi

Maaf, Untuk Memberikan Komentar Anda Harus Login !!!