undefined index.page
Posted: Tue Sep 16, 2014 9:47 pm
When I test my code below i get a warning one every line that has
on it.
The warning is:
Undefined index: page with the page being index.php.
I am not on a server just using phpDesigner to test it. If I leave out the code and just use the includes the template portion loads fine.
nav bar:
Code: Select all
if($_GET['page']The warning is:
Undefined index: page with the page being index.php.
I am not on a server just using phpDesigner to test it. If I leave out the code and just use the includes the template portion loads fine.
Code: Select all
<?php
include("includes/header.html");
include("includes/navbar.html");
if($_GET['page'] == "resume"){
include("includes/resume.html");
}
if($_GET['page'] == "portfolio"){
include("includes/portfolio.html");
}
if($_GET['page'] == "contact"){
include("includes/contact.html");
}
if($_GET['page'] == "home"){
include("includes/home.html");
}
include("includes/footer.html");
?>
Code: Select all
<div class='navbar'>
<div class='button'><a href='index.php'>Home</a></div>
<div class='button'><a href='index.php?page=resume'>Resume</a></div>
<div class='button'><a href='index.php?page=portfolio'>Portfolio</a></div>
<div class='button'><a href='index.php?page=contact'>Contact Me</a></div>
</div>