Oh right, sorry I was assuming you wanted to know how to move between pages of a website using url variables (which is done in that way, using sub-url-variables to define extra settings like files to view, eg. ?action=viewfile&file=myfile.txt). If you want to emit large datasets of information there are obviously easy ways to do it. You way of checking for the file and emitting it is a good idea (obviously you want to limit what files they can access or they may trick your scripting into emitting the source code for your website, or something stupid like that), althrough using a MySQL database is a better idea.
But either way if you wanted to do that, you could do it like this;
if (isset($_GET['action']) == false)
{
// The ?action=xxx variable is not set so just show homepage here.
}
else
{
// Check if our file exists (huge security hole here, you can emit pretty much any file on the server, you need to validate the url first).
if (file_exists('MyStorageDirectory\' . $_GET['action']) == true)
{
echo file('MyStorageDirectory\' . $_GET['action']);
}
else
{
echo 'File dosen't exist.';
}
}
If you can give me a more exact view of what your intending to do I may be able to help better.