Home - Computer Science Department Bi
eck
title
head
ody
require the loginform and related code
require 'includes/loginform.php';
?
div
require the menu and related code
require 'includes/menu.php';
?
div
Birkbeck University
h1
Department of Computer Science
h1
$pageRef = 'Intranet';
displaySessionData($pageRef);
?
Welcolme to the Intranet page, click on the link to see the results:
p
require the submenu and related code
require 'includes/submenu.php';
?
div
Each of the pages contain the results for the related module.
p
require the footer and related code
include 'includes/footer.php';
}else{
echo "
You cannot access this page without logging in
p>";
}
?
ody
html
__MACOSX/k/._intranet.php
k/admin.php
?php
require 'includes/functions.php';
startSession();
if (isset($_SESSION['password']) AND
username and password required to access the admin page.
(isset($_SESSION['username']) AND
else message 'You cannot access this page...' at the bottom of the page.
($_SESSION['username'] === 'admin') AND
($_SESSION['password'] === 'dcsadmin01'))) {
?
!DOCTYPE html PUBLIC "-
W3C
DTD XHTML 1.0 Strict
EN" "http:
www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"
html xmlns="http:
www.w3.org/1999/xhtml" xml:lang="en" lang="en"
Home - Computer Science Department Bi
eck
title
head
ody
require 'includes/loginform.php';
?
div
require 'includes/menu.php';
?
div
Birkbeck University
h1
Department of Computer Science
h1
$pageRef = 'Administration';
displaySessionData($pageRef);
?>
As the administrator you are able to set up new users.
p
Remember that you need to fill in all of the fields.
p
You can only register a user once.
p
require 'includes
egistrationform.php';
include 'includes/footer.php';
}else{
echo "
You cannot access this page without logging in as an administato
p>";
}
?
ody
html
__MACOSX/k/._admin.php
k/databasetech.php
?php
require 'includes/functions.php';
startSession();
if (isset($_SESSION['password'])) {
equired to access this page, else} access denied message, page bottom.
?
!DOCTYPE html PUBLIC "-
W3C
DTD XHTML 1.0 Strict
EN" "http:
www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"
html xmlns="http:
www.w3.org/1999/xhtml" xml:lang="en" lang="en"
Introduction to Database Technology - DT Results
title
head
ody
require the loginform and related code
require 'includes/loginform.php';
?
div
require the menu and related code
require 'includes/menu.php';
?
div
Birkbeck University
h1
Department of Computer Science
h1
$pageRef = 'Introduction to Database Technology';
displaySessionData($pageRef);
?
require the submenu and related code
require 'includes/submenu.php';
?
div
Introduction to Database Technology - DT Results
h2
Yea th | Students th | Pass th | Fail (no resit) th | Resit th | Withdrawn th t | 2012/13 td | 60 td | 40 td | 7 td | 3 td | 10 td t | 2013/14 td | 45 td | 25 td | 5 td | 15 td | 0 td t | 2014/15 td | 50 td | 35 td | 3 td | 7 td | 5 td t | 2015/16 td | 48 td | 30 td | 8 td | 3 td | 7 td t table div require the footer and related code include 'includes/footer.php'; }else{ echo "You cannot access this page without logging in p>"; } ?> ody> html __MACOSX/k/._databasetech.php k/css esults.css table { font-family: arial, sans-serif; border-collapse: collapse; width: 50%; } td, th { border: 2px solid #dddddd; text-align: left; padding: 5px; } tr:nth-child(even) { background-color: #dddddd; } .tables{ margin-bottom: 30px; } ody{ font-family: Arial, Helvetica, sans-serif; background-color: #f2f2ef; margin: auto; width: 70%; border: 2px solid darkgrey; border-radius: 5px; padding: 2em; } h1{ margin: 20px 5px 0px 10px; color: #651c65; } h2{ padding: 5px; margin: 10px; } h3{ color: #651c65; padding: 5px; margin: 10px; } h4{ text-align: right; color: #651c65; } li{ color:#651c65; text-align: right; list-style-position: inside; } h5{ text-align: right; color: darkgrey; } p{ padding: 5px; margin: 10 15px; } .nav ul { list-style-type: none; margin: 5px; padding: 0; overflow: hidden; } .nav li { float: left; background-color: white; border: 1px solid darkgrey; } .nav li a
Answered Same Day
Dec 20, 2021
Solution
Arun Shankar answered on
Jan 04 2021
k/.DS_Store k/addstaff.php ?php * This file has the logic to add a new staff member. It gets the staff member details via the submission of the form in the admin page. All that it does is to append the username and password to the file users.txt. * $uname = $_POST["user"]; $pass = $_POST["pass"]; $uname = trim($uname); $pass = trim($pass); if(strpos($pass,'staff')==false) { echo "The password must follow the syntax dcsstaffXY"; return; } Check if a user with that name exists already $file = fopen("includes/users.txt","r"); Output lines until EOF is reached while(!feof($file)) { $line = fgets($file, 1024); $bits = explode(',', $line); $bits[0] = trim($bits[0]); if($uname==$bits[0]) { echo "A user with that username exists already. Please give a new username."; fclose($file); return; } } fclose($file); $fp = fopen("includes/users.txt","a"); opens file in append mode fwrite($fp,"\n".$uname.",".$pass); fclose($fp); header('location:admin.php'); ? k/admin.php ?php require 'includes/functions.php'; session_start(); if(!isset($_SESSION["type"])) { echo "You are not authorized to access this page."; return; } if($_SESSION["type"]!=1) The user is not an admin { echo "Only admins authorized to access this page."; return; } ? style type="text/css" .button { background-color: #4CAF50; /* Green * border: none; color: white; font-family: cali i; border-radius: 15px; padding: 15px 32px; text-align: center; text-decoration: none; display: inline-block; font-weight: bold; font-size: 16px; margin: 4px 2px; cursor: pointer; } style !DOCTYPE html PUBLIC "- W3C DTD XHTML 1.0 Strict EN" "http: www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd" html xmlns="http: www.w3.org/1999/xhtml" xml:lang="en" lang="en" Admin - CS Dept. Bi eck title head ody style="background-color: white;" require the menu and related code require 'includes/menu.php'; ? div | Department of Computer Science, Birkbeck University h1 Welcome to the admin page. p You can add a new staff member by filling this form: p td t |
SOLUTION.PDF
Answer To This Question Is Available To Download
Submit New Assignment
Please select no of pages for your assignment
Please select references for your assignment
Please select level for your assignment
x
I am Online - Talk to me!
Please fill out the form below to start chatting with the next available agent.
Mehmet Mert
3
|