Commit eb6f5bed authored by Sorrel Harriet's avatar Sorrel Harriet
Browse files

replacing week 1 test app

parent 4ecac790
This is a test PHP application. You can upload use it to test your LAMP stack. You can also browse the directory structure to get an idea of how PHP web applications are commonly structured. You can also read this README file to find out the sorts of things that should be included in a README file!
Author & Contact
Sorrel Harriet
Installation Instructions
Upload the application to your web root folder. No further actions needed!
Configuration Instructions
There is nothing to configure.
# Write some helper functions here...
// Code to detect whether index.php has been requested without query string
// If no page parameter detected...
if (!isset($_GET['page'])) {
$id = 'home'; // display home page
} else {
$id = $_GET['page']; // else requested page
$content = '';
// Switch statement to decide content of page will go here.
// Regardless of which "view" is displayed, the variable $content will
switch ($id) {
case 'home' :
include 'views/home.php';
case 'page_2' :
include 'views/page_2.php';
default :
include 'views/404.php';
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "">
<html xmlns="" xml:lang="en" lang="en">
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>Test Application</title>
<li><a href="index.php">Home</a></li>
<li><a href="index.php?page=page_2">Page 2</a></li>
// Display content for requested view.
echo $content;
$content = "<h1>Page not found</h1>";
$content .= "<p>Sorry, the page you requested could not be found.</p>";
$content = '<h1>Hello world!</h1>';
$content .= '<p>If you\'re reading this, it means you have successfully launched the <b>test app</b>.</p>'
$content = '<h1>Welcome to page 2!</h1>';
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment