Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Ifrah Shahid
lab-exercises
Commits
cd6b3d92
Commit
cd6b3d92
authored
Nov 13, 2016
by
Sorrel Harriet
Browse files
changing name of content variable to match last week
parent
7eeebe64
Changes
6
Hide whitespace changes
Inline
Side-by-side
lab-6/lecture-task/index_v1.php
View file @
cd6b3d92
...
...
@@ -5,16 +5,16 @@ $myvar = $_GET['id'];
}
else
{
$myvar
=
'home'
;
}
$
html
=
"<!DOCTYPE html
$
content
=
"<!DOCTYPE html
<html>
<head>
<meta charset='utf-8'/>
<title>Music Store:
$myvar
</title>
</head>
<body>"
;
$
html
.
=
"<nav><ul><a href='index_v1.php?id=home'>Home</a></li>"
;
$
html
.
=
"<li><a href='index_v1.php?id=customers'>Customers</a></li>"
;
$
html
.
=
"<li><a href='index_v1.php?id=orders'>Orders</a></li></ul></nav>"
;
$
content
.
=
"<nav><ul><a href='index_v1.php?id=home'>Home</a></li>"
;
$
content
.
=
"<li><a href='index_v1.php?id=customers'>Customers</a></li>"
;
$
content
.
=
"<li><a href='index_v1.php?id=orders'>Orders</a></li></ul></nav>"
;
switch
(
$myvar
)
{
case
'home'
:
include
'views/home.php'
;
...
...
@@ -25,6 +25,6 @@ case 'orders' :
include
'views/orders.php'
break
;
default
:
include
'views/404.php'
;}
$
html
.
=
"</body></html>"
;
echo
$
html
;
$
content
.
=
"</body></html>"
;
echo
$
content
;
?>
lab-6/lecture-task/index_v2.php
View file @
cd6b3d92
...
...
@@ -7,7 +7,7 @@ include('templates/header.html');
include
(
'templates/nav.html'
);
// define variable for storing body HTML
$
html
=
""
;
$
content
=
""
;
// check if 'page' parameter is set in query string
if
(
isset
(
$_GET
[
'page'
]))
{
...
...
@@ -32,7 +32,7 @@ default :
}
// output body HTML
echo
$
html
;
echo
$
content
;
// include the footer HTML
include
(
'templates/footer.html'
);
...
...
lab-6/lecture-task/views/404.php
View file @
cd6b3d92
<?php
$
html
.
=
"<h1>Oops!</h1>"
;
$
html
.
=
"<p>Sorry, the page you're looking for cannot be found.</p>"
;
$
content
.
=
"<h1>Oops!</h1>"
;
$
content
.
=
"<p>Sorry, the page you're looking for cannot be found.</p>"
;
?>
lab-6/lecture-task/views/customers.php
View file @
cd6b3d92
<?php
$
html
.
=
"<h1>Customers</h1>"
;
$
html
.
=
"<p>Browse the app's customers here...maybe add/delete/edit customers too...whatever.</p>"
;
$
content
.
=
"<h1>Customers</h1>"
;
$
content
.
=
"<p>Browse the app's customers here...maybe add/delete/edit customers too...whatever.</p>"
;
?>
lab-6/lecture-task/views/home.php
View file @
cd6b3d92
<?php
$
html
.
=
"<h1>Welcome to the Music Store</h1>"
;
$
html
.
=
"<p>Some content here...</p>"
;
$
content
.
=
"<h1>Welcome to the Music Store</h1>"
;
$
content
.
=
"<p>Some content here...</p>"
;
?>
lab-6/lecture-task/views/orders.php
View file @
cd6b3d92
<?php
$
html
.
=
"<h1>Orders</h1>"
;
$
html
.
=
"<p>Browse the orders here...maybe add/delete/edit/mark dispatched...whatever.</p>"
;
$
content
.
=
"<h1>Orders</h1>"
;
$
content
.
=
"<p>Browse the orders here...maybe add/delete/edit/mark dispatched...whatever.</p>"
;
?>
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment