This is my first PHP project and i am going a little nuts over this. lol.
I am trying to set the php file to load txt files from "files" DIR instead of the current DIR (where php is located) , if you know what i mean.
this loads from current DIR (where php is located)
Expand|Select|Wrap|Line Numbers
- //Load filename from URL
- if (isset($_GET['page']) && (file_exists($_GET['page'].'.txt'))) //If the url contains an existing filename
- {
- $filename = $_GET['page'].'.txt'; //Load it
- }
- else
- {
- $filename = 'files/'.'index.txt'; //Otherwise, default to index.txt
- $htmltitle= 'Home';
- }
i have tried many different ways but without success..