PHP lab 8
@@ -1 +1,3 @@
|
||||
INFO-3174 (Web Security)/kali-linux-2025.4-vmware-amd64.vmwarevm
|
||||
INFO-3174 (Web Security)/kali-linux-2025.4-vmware-amd64.vmwarevm
|
||||
*.mp4
|
||||
*.mkv
|
||||
|
After Width: | Height: | Size: 76 KiB |
|
After Width: | Height: | Size: 64 KiB |
|
After Width: | Height: | Size: 65 KiB |
|
After Width: | Height: | Size: 74 KiB |
|
After Width: | Height: | Size: 75 KiB |
|
After Width: | Height: | Size: 85 KiB |
@@ -0,0 +1,95 @@
|
||||
body {
|
||||
font-family: "Roboto", sans-serif;
|
||||
font-style: normal;
|
||||
font-size: 20px;
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
color: #555555;
|
||||
}
|
||||
|
||||
/* Header Styles */
|
||||
header .logo {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
padding: 0.5rem;
|
||||
}
|
||||
|
||||
header .logo i {
|
||||
display: block;
|
||||
color: teal;
|
||||
font-size: 3rem;
|
||||
}
|
||||
|
||||
header .logo span {
|
||||
color: #666677;
|
||||
font-size: 2rem;
|
||||
font-weight: 300;
|
||||
}
|
||||
|
||||
header .logo span strong {
|
||||
font-weight: 600;
|
||||
}
|
||||
|
||||
header nav {
|
||||
background-color: teal;
|
||||
padding-top: 5px;
|
||||
}
|
||||
|
||||
header nav ul {
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
list-style: none;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
header nav ul li {
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
display: block;
|
||||
}
|
||||
|
||||
header nav ul li a {
|
||||
display: block;
|
||||
padding: 0.75rem;
|
||||
color: #ffffff;
|
||||
text-decoration: none;
|
||||
font-size: 1.1rem;
|
||||
}
|
||||
|
||||
header nav ul li a:hover {
|
||||
text-decoration: underline;
|
||||
}
|
||||
|
||||
header nav ul li a.active {
|
||||
color: teal;
|
||||
background-color: #ffffff;
|
||||
}
|
||||
|
||||
/* Main Styles */
|
||||
main {
|
||||
display: block;
|
||||
padding: 2rem;
|
||||
}
|
||||
|
||||
main h1 {
|
||||
color: #666677;
|
||||
padding: 0;
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
/* Footer Styles */
|
||||
footer {
|
||||
display: block;
|
||||
padding: 1.5rem 1rem;
|
||||
background-color: teal;
|
||||
color: rgba(255, 255, 255, 0.75);
|
||||
text-align: center;
|
||||
font-size: 1rem;
|
||||
}
|
||||
|
||||
footer strong {
|
||||
font-weight: 600;
|
||||
color: rgba(255, 255, 255, 0.85);
|
||||
}
|
||||
|
After Width: | Height: | Size: 24 KiB |
@@ -0,0 +1,4 @@
|
||||
<?php define("TITLE", "Best Pizza In The World!"); ?>
|
||||
<?php include("template/header.php"); ?>
|
||||
<p>This is the content of the home page.</p>
|
||||
<?php include("template/footer.php"); ?>
|
||||
@@ -0,0 +1,43 @@
|
||||
<?php
|
||||
define("TITLE", "User Login");
|
||||
include("template/header.php");
|
||||
print("<h2>Login Form<h2>");
|
||||
|
||||
$formStart = "<form class='login' action='login.php' method='post'>";
|
||||
$emailLabel = "<label for='email'>Email:</label>";
|
||||
$emailInput = "<input type='email' name='email'>";
|
||||
$passLabel = "<label for='pass'>Password:</label>";
|
||||
$passInput = "<input type='password' name='pass'>";
|
||||
$submit = "<input type='submit' name='submit' value='Log In'>";
|
||||
$formEnd = "</form";
|
||||
|
||||
if ($_SERVER['REQUEST_METHOD'] == 'POST') {
|
||||
$email = htmlspecialchars($_POST['email']);
|
||||
$password = htmlspecialchars($_POST['pass']);
|
||||
|
||||
$stickyForm = $formStart .
|
||||
$emailLabel . $emailInput .
|
||||
$passLabel . $passInput .
|
||||
$submit .
|
||||
$formEnd;
|
||||
|
||||
if (!empty($email) && !empty($password)) {
|
||||
if ((strtolower($email) == 'test@test.com') && ($password == 'test')) {
|
||||
ob_end_clean();
|
||||
header('Location: specials.php');
|
||||
exit();
|
||||
} else {
|
||||
print("<p>Email or password is incorrect. Please try again.</p>" . $stickyForm);
|
||||
}
|
||||
} else {
|
||||
print("<p>Email and password are required. Please try again.</p>" . $stickyForm);
|
||||
}
|
||||
} else {
|
||||
print($stickyForm = $formStart .
|
||||
$emailLabel . $emailInput .
|
||||
$passLabel . $passInput .
|
||||
$submit .
|
||||
$formEnd);
|
||||
}
|
||||
|
||||
include("template/footer.php");
|
||||
@@ -0,0 +1,16 @@
|
||||
<?php
|
||||
define("TITLE", "Today's Specials");
|
||||
date_default_timezone_set("America/Toronto");
|
||||
$date = date("l F j Y");
|
||||
$message = "<h2>These are our specails for $date:</h2>
|
||||
<p>Extra Large Meat Lovers Pizza - $17.99</p>
|
||||
<p>Toppings:</p>
|
||||
<ul>
|
||||
<li>Pepperoni</li>
|
||||
<li>Bacon</li>
|
||||
<li>Ham</li>
|
||||
<li>Mozzarella Cheese</li>
|
||||
</ul>";
|
||||
include("template/header.php");
|
||||
print($message);
|
||||
include("template/footer.php");
|
||||
@@ -0,0 +1,14 @@
|
||||
<!-- Footer -->
|
||||
<footer class="siteFooter">
|
||||
<p>
|
||||
<strong>© 2025</strong>l_mclean215318's Pizza. All rights reserved.
|
||||
</p>
|
||||
<?php
|
||||
date_default_timezone_set("America/Toronto");
|
||||
print(date("l F j, Y"));
|
||||
?>
|
||||
</footer>
|
||||
|
||||
<?php
|
||||
ob_end_flush();
|
||||
?>
|
||||
@@ -0,0 +1,44 @@
|
||||
<?php
|
||||
ob_start();
|
||||
?>
|
||||
<!-- Header -->
|
||||
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<link rel="stylesheet" type="text/css" href="css/styles.css">
|
||||
<title><?php if (defined("TITLE")) {
|
||||
print(TITLE);
|
||||
} else {
|
||||
print("l_mclean215318's Pizza");
|
||||
} ?></title>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<header class="siteHeader">
|
||||
<section>
|
||||
<h1 class="logo">
|
||||
<a href="index.php">
|
||||
<img src="images/logo.png" alt="Pizza logo">
|
||||
l_mclean215318's Pizza
|
||||
</a>
|
||||
</h1>
|
||||
<nav>
|
||||
<ul>
|
||||
<li>
|
||||
<a href="#">Place Order</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="#">Menu</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="specials.php">Specials</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="login.php">Register</a>
|
||||
</li>
|
||||
</ul>
|
||||
</nav>
|
||||
</section>
|
||||
</header>
|
||||
</body>
|
||||
@@ -0,0 +1,54 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<link rel="stylesheet" type="text/css" href="css/styles.css">
|
||||
<title>l_mclean215318's Webpage</title>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<!-- Header -->
|
||||
<header class="siteHeader">
|
||||
<section>
|
||||
<h1 class="logo">
|
||||
<a href="index.php">
|
||||
<img src="images/logo.png" alt="Pizza logo">
|
||||
l_mclean215318's Pizza
|
||||
</a>
|
||||
</h1>
|
||||
<nav>
|
||||
<ul>
|
||||
<li>
|
||||
<a href="order.php">Place Order</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="#">Menu</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="#">Specials</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="#">Register</a>
|
||||
</li>
|
||||
</ul>
|
||||
</nav>
|
||||
</section>
|
||||
</header>
|
||||
|
||||
<!-- Main Content -->
|
||||
<main class="siteContent">
|
||||
<h1>Welcome</h1>
|
||||
<p>This is the content of the home page.</p>
|
||||
</main>
|
||||
|
||||
<!-- Footer -->
|
||||
<footer class="siteFooter">
|
||||
<p>
|
||||
<strong>© 2025</strong>l_mclean215318's Pizza. All rights reserved.
|
||||
</p>
|
||||
</footer>
|
||||
</body>
|
||||
|
||||
</html>
|
||||