-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcms.php
More file actions
65 lines (55 loc) · 1.25 KB
/
cms.php
File metadata and controls
65 lines (55 loc) · 1.25 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
64
<!doctype html>
<html lang="en-UK">
<head>
<link rel="stylesheet" href="cmsstyle.css" />
<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> CMS </title>
<style>
</style>
</head>
<body>
<header>
</header>
<nav>
<img src="uccLogo.png" />
<a href="cms.php"> Home </a>
<a href="cms.php?page=1"> Studies </a>
<a href="cms.php?page=2""> About Me </a>
<a href="cms.php?page=3"> Links </a>
</nav>
<section>
<?php
function checkFile($fileName){
if (is_readable($fileName)) {
include $fileName;
} else {
echo "Error. Content file cannot be retrieved.";
}
}
if (isset($_GET['page'])){
$inputValue=$_GET['page'];
switch ($inputValue) {
case "1" :
checkFile("text1.txt");
break;
case "2" :
checkFile("text2.txt");
break;
case "3":
checkFile("text13.txt");
break;
default :
echo "Error. Content file not accessible.";
}
}
else {
include "home.txt";
}
?>
</section>
<footer>
</footer>
</body>
</html>