I feel dumb for asking this, but whatever.
Here's my current page for my stories: http://www.brianellisrules.com/stories/
There are two .php files in the directory. The first one displays a menu of all the stories I have, the second actually displays the stories.
index.php looks like:
menu.inc is just a file with links to all my stories... which are also .inc files
story.php looks like:
I'm setting the $story variable when I link to each story... (http://www.brianellisrules.com/stories/story.php?story=about)
I'm sure there's a way to include an if statement, and do all this with one file... I'm just a moron. I'm thinking the basic structure would look like:
Also, how are variables stored? Let's say, I get this setup working... if someone goes to the page for the first time, there's no value for $story, so the menu.inc file would be displayed. Perfect. From there, the person would select one of the stories, so $story would now have a value. Perfect. If they wanted to go back to the story menu page and clicked the link for "http://www.brianellisrules.com/stories/" the index.php file would be loaded... but would the value for $story be saved? Would it automatically load the most recent story instead of the menu? If so, how do I get around this?
Here's my current page for my stories: http://www.brianellisrules.com/stories/
There are two .php files in the directory. The first one displays a menu of all the stories I have, the second actually displays the stories.
index.php looks like:
PHP:
<?php
include('/home2/brian/public_html/head.inc');
include('menu.inc');
?>
story.php looks like:
PHP:
<?php
include('/home2/brian/public_html/head.inc');
include($story.'.inc');
?>
I'm sure there's a way to include an if statement, and do all this with one file... I'm just a moron. I'm thinking the basic structure would look like:
PHP:
<?php
if ($story= null);
{
include(menu.inc);
}
else;
{
include($story.'.inc');
}
?>
Also, how are variables stored? Let's say, I get this setup working... if someone goes to the page for the first time, there's no value for $story, so the menu.inc file would be displayed. Perfect. From there, the person would select one of the stories, so $story would now have a value. Perfect. If they wanted to go back to the story menu page and clicked the link for "http://www.brianellisrules.com/stories/" the index.php file would be loaded... but would the value for $story be saved? Would it automatically load the most recent story instead of the menu? If so, how do I get around this?