Thread: Im a newb
View Single Post
Old 10-15-2002, 11:43 PM   #5 (permalink)
redhead
Newbie
 
redhead's Avatar
 
Join Date: Jun 2002
Location: Denmark
Posts: 1,709
redhead is on a distinguished road
What do you mean with "default page" ??

If I'm catching what you want, you can do it something like:
PHP Code:
<?php
if (isset($the_file) && file_exists("data/$thefile.txt"))
{
include(
"/data/$thefile.txt");
}
else
{
  if(isset(
$the_file))
    include(
"data/error.txt");
  else
    include(
"data/default.txt");
}
?>
This allows the user to parse a ?the_file=something along in the url, and you will include that, if it exists. If it dosn't exists they will get an error, if they are just viewing the page, without any parsing of the the_file argument, they will be shown the default file.

Is it something like that you wanted ?
__________________
Don't worry Ma'am, We're university students, We know what We're doing.
-----
If you pull the pin, Mr.Grenade would no longer be your friend.
-----
01000111 01101111 00100000 01000011 00100000 00100001
redhead is offline   Reply With Quote