Hi, I am trying to make my first dynamic site using php. I am however getting the following error message on my first page:
_______________________________________________________
My first Page
home
tutorials
Notice: Undefined index: page in C:\wamp\www\test\index.php on line 18
welcome to my website
______________________________________________________
my tutorial link works and doesnt display the error. but my index page makes this come up. my code is as follows(ive marked line 16 on here, not on my actual script)
_______________________________________________________
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "[
www.w3.org];
<html xmlns="[
www.w3.org];
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>My First Page</title>
</head>
<body>
<h1>My first Page</h1>
<a href="index.php">home</a><br />
<a href="index.php?page=tutorials">tutorials</a><br />
<?php
*****THIS IS LINE 16***** $page = $_GET['page'];
if ($page)
{
include ("content/".$page.".php"
;
}
else
{
echo "welcome to my website";
}
?>
</body>
</html>
______________________________________________________
Please help if you can, Im using wamp and firefox!