-
Notifications
You must be signed in to change notification settings - Fork 1
/
proses.php
56 lines (51 loc) · 1.83 KB
/
proses.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
<?php
include "phpcon/link.php";
$username = $_POST['nama_pengguna'];
$password = md5($_POST['kata_sandi']);
$login = mysql_query("SELECT * FROM akun WHERE username='".htmlentities($username)."' AND password='$password'");
$hasil = mysql_num_rows($login);
$r = mysql_fetch_array($login);
$ss = mysql_query("select*from detail_tampilan where id_aku='$r[id]'");
$ee = mysql_fetch_array($ss);
if ($hasil > 0)
{
$d = date("d");
$m = date("m");
$y = date("Y");
$h = date("H");
$i = date("i");
$s = date("s");
$ada = mysql_query("select*from terakhirmasuk where id_akun='$r[id]'");
$masuk = mysql_fetch_array($ada);
$ip = GETENV('REMOTE_ADDR');
if(empty($masuk['id_akun'])){
mysql_query("insert into terakhirmasuk values('$r[id]','$h','$i','$s','$d','$m','$y','$ip')");
}
else if(!empty($masuk['id_akun'])){
mysql_query("update terakhirmasuk set ip='$ip', jam='$h',menit='$i',detik='$s',tgl='$d',bln='$m',tahun='$y' where id_akun='$r[id]'");
}
session_start();
session_register("id");
session_register("username");
session_register("password");
session_register("user_akses");
session_register("tranz");
session_register("navbar");
session_register("background");
session_register("awal");
session_register("limitan");
$_SESSION['id'] = $r['id'];
$_SESSION['username'] = $r['username'];
$_SESSION['password'] = $r['password'];
$_SESSION['user_akses'] = $r['user_akses'];
$_SESSION['navbar'] = $ee['navbar'];
$_SESSION['background'] = $ee['background'];
$_SESSION['tranz'] = $ee['pas'];
$_SESSION['awal'] = 0;
$_SESSION['limitan'] = $ee['maxindex'];
header('location:index.php');
}
else{
header("location:index.php?rpl=galau");
}
?>