-
Notifications
You must be signed in to change notification settings - Fork 0
/
logintamu.php
85 lines (43 loc) · 982 Bytes
/
logintamu.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
<?PHP
session_start();
if (isset($_SESSION["logged_in"]) AND $_SESSION["logged_in"]==true)
{
header("location:home.php");
}
else
{
//VARIABEL UNTUK LINK
$db_tabel_user="data_user";
$nama_user="tamu";
$password="tamunyavayu";
//LINK
require "koneksi_ke_mysql.php";
$search=mysqli_query($link,"SELECT * FROM ".$db_tabel_user." WHERE nama_lengkap='".$nama_user."'");
if(mysqli_num_rows($search)==1)
{
$pesan="Login tamu berhasil";
session_start();
$_SESSION["email"]="[email protected]";
$_SESSION["logged_in"]=true;
header("location:home.php");
}
else
{
$pesan= "Login tamu gagal! Silahkan <a href='index.php'>ulangi</a>";
}
echo
"
<!DOCTYPE html>
<html>
<head>
<title>Login Tamu - Tel-Med</title>
</head>
<body>
<h1>Masuk ke Tel-Med sebagai tamu</h1>
<br>
".$pesan."
</body>
</html>
";
}
?>