-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathhome.php
More file actions
59 lines (52 loc) · 1.59 KB
/
home.php
File metadata and controls
59 lines (52 loc) · 1.59 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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
<?php
@include 'config.php';
session_start();
$user_id = $_SESSION['user_id'];
if(!isset($user_id)){
header('location:login_form.php');
};
if(isset($_GET['logout'])){
unset($user_id);
session_destroy();
header('location:login_form.php');
}
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Home</title>
<link rel="stylesheet" href="css/st.css" />
</head>
<body>
<div class="container">
<div class="profile">
<?php
$select = mysqli_query($conn, "SELECT * FROM `user_form` WHERE id = '$user_id'")
or die('query failed');
if(mysqli_num_rows($select) > 0){
$fetch = mysqli_fetch_assoc($select);
}
if($fetch['image'] == ''){
echo '<img src="images/default-image.jpg">';
}else{
echo '<img src="uploaded_img/'.$fetch['image'].'">';
}
?>
<h3><?php echo $fetch['name']; ?></h3>
<a href="update_profile.php" class="butun">Изменить профиль</a>
<a href="profinder/main.php" class="butun">Главная</a>
<a href="home.php?logout=<?php echo $user_id; ?>" class="delete-btn"
>Выйти</a
>
<p>
<a href="login_form.php">login</a>
<span style="padding: 7px">или</span>
<a href="register_form.php">registr</a>
</p>
</div>
</div>
</body>
</html>