2
header("X-UA-Compatible: IE=edge,chrome=1");
5
function htmlsafe($str){
6
return $str=htmlspecialchars($str,ENT_QUOTES,'UTF-8');
9
function generatePassword($length){
10
$arr = str_split('ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz1234567890'); //Array of characters that may occur in the password
11
shuffle($arr); //Shuffle array
12
$arr = array_slice($arr, 0, $length); //Extract the first $length characters from the shuffled array
13
return implode('', $arr); //Make string of the array and return the result
16
function addBackLink($postBacks){
17
echo "<form name='backLink' action='.' method='post'>";
18
foreach($postBacks as $name=>$value){
19
echo "<input type='hidden' name='".$name."' value='".$value."' />";
21
echo "<a href='#' onclick='document[\"backLink\"].submit();return false;'><-- Back</a>";
25
$pagetitle = "Quiz system";
29
include_once "login/checkLogin.php";
33
if (isset($_POST['logoutLink'])) {
34
unset($_SESSION['userName']);
35
unset($_SESSION['userPassword']);
36
unset($_SESSION['userType']);
38
} else if (checklogin()) {
40
include "dbconnect.php";
43
$content="frontpage.html.php";
45
//Include based on menu selection
46
if(isset($_POST['dataLink'])) {
47
include "data/index.php";
48
} else if(isset($_POST['registerStudentsLink']) || isset($_POST['parseSubmit'])) {
49
include "registerStudents/index.php";
50
} else if(isset($_POST['listStudentsLink'])){
51
include "students/index.php";
52
} else if(isset($_POST['listQuizzesLink'])){
53
include "quiz/index.php";
54
} else if(isset($_POST['checkQuizzesLink'])){
55
include "quizChecking/index.php";
56
}else if(isset($_POST['coursesLink'])){
57
include "course/index.php";
58
} else if (isset($_POST['searchString'])) {
59
include "search/index.php";
61
$_POST['aboutPageLink']=true;
64
//Enclosing page frame //checkQuizzesLink
65
include "pageframe.html.php";
69
include "login/index.php";
b'\\ No newline at end of file'