Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 57b614d

Browse files
Update index.php
Added admin section
1 parent 497e7a8 commit 57b614d

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

‎index.php‎

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
11
<?php
2-
// Start session
32
session_start();
4-
if (!isset($_SESSION['user'])) {
5-
header("Location: admin.php");
3+
if (!isset($_SESSION['user']) || $_SESSION['role'] !== 'admin') {
4+
header("Location: login.php");
65
exit;
76
}
87

@@ -44,10 +43,10 @@
4443
<head>
4544
<meta charset="UTF-8">
4645
<meta name="viewport" content="width=device-width, initial-scale=1.0">
47-
<title>Upload Form</title>
46+
<title>Admin Area</title>
4847
</head>
4948
<body>
50-
<h1>Upload Form</h1>
49+
<h1>Admin Area</h1>
5150
<form method="post" enctype="multipart/form-data">
5251
<label for="file">Choose file:</label>
5352
<input type="file" name="file" id="file" required>

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /