-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathuser.php
More file actions
44 lines (40 loc) · 1.16 KB
/
user.php
File metadata and controls
44 lines (40 loc) · 1.16 KB
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
<?php
require_once('header.php');
require_once('config.php');
session_start();
$email = $_SESSION['email'];
$id = $_SESSION['id'];
$_SESSION['id'] = $id;
$_SESSION['email'] = $email;
$name = $surname = $email = $username = '';
$sql = "SELECT * FROM users WHERE id='$id'";
$result = mysqli_query($db, $sql);
if(mysqli_num_rows($result) > 0)
{
while($row = mysqli_fetch_assoc($result))
{
$name = $row["name"];
$surname = $row["surname"];
$email = $row["email"];
$username = $row["username"];
$kontrol = "SELECT admin FROM users WHERE email='$email'";
$kontrol2=mysqli_query($db,$kontrol);
$sonuc = $kontrol2->fetch_array(MYSQLI_NUM);
if($sonuc[0] > 0)
{
$admin_paneli="<div style='justify-content: center; display: flex; margin-top:-50px;'>
<a href='/digituslogin/admin.php'><button type='button' class='btn btn-primary'>Admin Paneli</button></a></div>";
}
}
}
else {
header("Location: index.php");
}
?>
<div class="jumbotron">
<center>
<h1>Welcome <?php echo $username.", ".$name." ".$surname; ?></h1><br>
<br><br><? echo $admin_paneli; ?><br>
<a href="logout.php"><button type="button" class="btn btn-danger">Logout</button></a>
</center>
</div>