-
Notifications
You must be signed in to change notification settings - Fork 1
/
index.php
71 lines (60 loc) · 2.27 KB
/
index.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
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
<?php
include('server.php');
if(isset($_SESSION['id'])){
header('location: welcome.php');
}
if (!isset($_SESSION['username'])) {
$_SESSION['msg'] = "You must log in first";
header('location: login.php');
}
if (isset($_GET['logout'])) {
session_unset();
session_destroy();
header("location: welcome.php");
}
if (isset($_GET['delete'])) {
$temp = $_SESSION['id'];
$sql = "DELETE FROM userData where userID = $temp;";
mysqli_query($db, $sql);
session_unset();
session_destroy();
header("location: login.php") AND die();
}
?>
<!DOCTYPE html>
<html>
<head>
<title>Welcome <?php echo $_SESSION['name'] ?></title>
<link rel="stylesheet" type="text/css" href="style.css">
<link rel="stylesheet" type="text/css" href="sample.css">
<link rel="stylesheet" type="text/css" href="dashboard.css">
<link rel="stylesheet" type="text/css" href="rem.css">
</head>
<body bgcolor = "#FFFFFF">
<link rel="icon" href="favicon.ico" type="image/x-icon"/>
<link href="https://fonts.googleapis.com/css?family=Amatic+SC&display=swap" rel="stylesheet">
<div class="test2">
<a href = 'http://localhost/connect/index.php'><img src="res/gplogo2.png" height = '110px' width = '110px'></a> <object align = "right">
<br>
<br>
<object align='right'>
<a class = "google" href = 'http://localhost/connect/NewConnect.php'> Find New Connections </a>
<?php if (!isset($_SESSION['username'])) : ?>
<a class = "google" href = 'http://localhost/connect/login.php'>
Login
</a>
<a class = "google" href = 'http://localhost/connect/finalsignup.php'> Signup </a>
<?php endif ?>
<?php if (isset($_SESSION['username'])) : ?>
<a class = "google" href = 'http://localhost/connect/welcome.php?logout=1'>
Logout
</a>
<a class = "google" href = 'http://localhost/connect/finalsignup.php'> Signup </a>
<?php endif ?>
</object>
</object>
</div>
<br>
<div class="userC"> No. of Users:
<b><?php echo $user_count ?>
</div>