I am trying to setup a website using PHP, and I am relatively new to PHP. I want to be able to make pages that are formatted something like this: http://example.com/index.php?p=pagename where the argument /?p
is page and the argument =pagename
is what the name of the page is.
I have tried a method of using:
<?php include('page.php') ?>
but that does not produce the result I want. That makes another page appear in the same page.
Here is what I have tried:
<?php include('page.php') ?>
I also tried:
<?php echo file_get_contents("html/header1.html"); ?>
<title>Cool Page</title>
<?php echo file_get_contents("html/header2.html"); ?>
This is page 1, the home page.
<?php echo file_get_contents("html/footer.html"); ?>
and
<?php include('html/header1.html'); ?>
<title>Cool Page</title>
<?php include('html/header2.html'); ?>
This is page 1, the home page.
<?php include('html/footer.html'); ?>
What I expect is when I want to be able to type in http://example.com/index.php?p=coolpage to get a page called "Cool Page" (if available!) but I am unable to know how that works.
Thanks for any help given!