Okay, I've figured out easily enough how to get that trendy index.php?page=links type of thing working with my webpage.
However, I've seen some webpages that just have ?page=links with no index.php (or whatever their index page is named) prepended before it.
So...my question is, how do they do that? Here's the code I'm using so far.
<?php
$directory = './webpage/';
if($page)
{
if(is_file("$directory$page.php"))
{
include("$directory$page.php");
}
else
{
echo ("<center>
<font class=size3>
Sorry this page does not exist.
</font>
</center>");
}
}
else
{
$mypage = 'main.php';
include("$directory$mypage");
}
?>
In my links that I'm writing, I've tried just specifying the link like this: <a href=?page=links>Links</a>, but once PHP parses the file, it sticks index.php in there every time. This isn't a huge deal, I'm just curious as to how they do it. 🙂