I'm experimenting with php, trying to understand how it works, and converted a static html site to a dynamic php site, just to see if I could get it done. I managed to get it to work, but I get a error saying
Notice: Undefined index: page in C:\xampp\htdocs\alt\index.php on line 12
(this is line 1 in the code below). Of course I managed to get this away from displaying by using and @ in the code, but I still wonder if I am doing something wrong... It works nevertheless as it should.
if (!$_GET['page']){
include 'content/index.inc.php';
}
else {
$page = htmlspecialchars($_GET['page']);
$path = 'content/'.$page.'.inc.php';
if (file_exists('content/'.$page.'.inc.php')){
include 'content/'.$page.'.inc.php';
}
else{
include 'content/error.inc.php';
}
}