Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- if (isset($_POST['submit'])){
- $user = $_POST['username'];
- $password = $_POST['password'];
- $sql = "SELECT * FROM `user` WHERE mnama='$user' OR memail ='$user' AND mpassword= md5('$password') ";
- $query = mysql_query($sql);
- if(mysql_num_rows($query)>0){
- $row = mysql_fetch_row($query);
- if($row[9]=="user"){
- if($row[8]==1){
- $_SESSION['member_id'] = $row[0];
- $_SESSION['KCFINDER']=array();
- $_SESSION['KCFINDER']['disabled'] = false;
- $_SESSION['KCFINDER']['uploadURL'] = "../tinymcpuk/gambar";
- $_SESSION['KCFINDER']['uploadDir'] = "";
- header('location:user_index.php');
- exit;
- }elseif($row[8]==0){
- $_SESSION['error']="Maaf akun anda tidakaktif";
- header('location:index.php?page=login');
- }
- }else{
- $_SESSION['admin_id'] = $row[0];
- $_SESSION['nama'] = $row[1];
- header('location:admin_index.php');
- exit;
- }
- }else{
- $_SESSION['error']="Username atau Password salah";
- header('location:index.php?page=login');
- }
- }
- ?>
Advertisement
Add Comment
Please, Sign In to add comment