Advertisement
azmilsyaifulloh

proseslogin.php

May 28th, 2016
72
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.67 KB | None | 0 0
  1. <?php
  2.     require_once("connect.php");
  3.     ob_start();
  4.     $email=$_GET['email'];
  5.     $password=md5($_GET['password']);
  6.     $query=mysql_query("select * from tuser where email='$email' and password='$password'");
  7.     $row_user=mysql_fetch_assoc($query);
  8.     if (($email!="")&&($password!=""))
  9.     {
  10.         if (($email==$row_user['email'])&&($password==$row_user['password']))
  11.         {
  12.             session_start();
  13.             session_register('email');
  14.             session_register('password');
  15.             header("location:admin/index.php");
  16.            
  17.         }
  18.         else
  19.         {
  20.             echo "<script>alert('password salah');location.href='index.php'</script>";
  21.         }
  22.     }
  23.     else
  24.     {
  25.         echo"<script>alert('kosong coy');location.href='index.php'</script>";
  26.     }
  27. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement