Repository navigation
Expand file tree
/
Copy pathstudent-page.php
More file actions
63 lines (55 loc) · 1.87 KB
/
Copy pathstudent-page.php
File metadata and controls
63 lines (55 loc) · 1.87 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
59
60
61
62
63
<?php
require('./read.php');
session_start();
if (!isset($_SESSION["username"])) {
header("location:index.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>Document</title>
<!-- <link rel="stylesheet" href="css/style.css"> -->
<style>
<?php include "css/style.css" ?>
</style>
</head>
<body>
<div class="homepage-main">
<div class="homepage-header">
<h2>Student Portal</h2>
<a href="logout.php" onclick=" return confirm('Are you sure you want to logout?');">Logout</a>
</div>
<!-- main container -->
<div class="homepage-content">
<p>Welcome: <span class="username"><?php echo $_SESSION["username"]; ?></p></span>
<!-- create data form -->
<div class="data-content">
<!-- display data (table) -->
<table class="data-table">
<tr>
<th>ID</th>
<th>NAME</th>
<th>AGE</th>
<th>EMAIL</th>
<th>GPA</th>
</tr>
<!-- data loop -->
<?php while($results = mysqli_fetch_array($sqlRead)) { ?>
<tr>
<td><?php echo $results['id'] ?></td>
<td><?php echo $results['name'] ?></td>
<td><?php echo $results['age'] ?></td>
<td><?php echo $results['email'] ?></td>
<td><?php echo $results['gpa'] ?></td>
</tr>
<?php } ?>
</table>
</div>
</div>
</div>
</body>
</html>