Forum Moderators: coopster
For instance
$content = array (
"htmlpage" => 1,
"htmlpage" => 2,
);
The numbers being the day of the month.
What will call each of the numbers by day of the month using php? Thanks!
I can piece the rest together all I need is how to call it per day.
if (isset($content[$date]) && file_exists($content[$date])) { // checks to make sure the date exists in the array and that the file you are including actually exists
//Your function goes here , in your cause you would want to use include probably
include($content[$date]); //Includ the date file
echo "Including $content[$date]";
} else {
// if the date doesn't exist which should never happen unless you are in a timewarp it will include the default file
include('default.html'); //Include the default file
echo "Including Default File";
}
?>
It wasn't calling the default file but I think thats because its not
calling the .html files either. I took the default out when not working just to test without it. The php wants to work, I am getting no error messages but it is no html page appears.
Do I have to stipulate somewhere what kind of file to call? Or will it put any kind of file in thats included in the array...
Thanks a bunch. :)
Named the file I put the include command in test10.php
and then put a few files in the same directory named test.html etc.
But it won't pull up the files. Even thought it says "failed to open file
test.html."
I have good luck with inlcude commands so don't know what the problem is, here is how mine looks.
<?php
include 'test.php';
?>
I am looking at the code you gave above, is it missing any brackets anywhere? Does your include look different than mine? Otherwise it makes no sense why it works for you but not for me.
Thank you!