I have an issue with PHP files displaying information site. I'm working on a localhost and my .htaccess file is correctly configured to display .php files, as a .php file works on an html file.
But, when I tried to make a switch variable to switch between different pages dependent on a date...
<?php
switch(date('l')) {
case 'Sunday': $page = 'sunday.html'; break;
case 'Monday': $page = 'monday.html'; break;
case 'Tuesday': $page = 'tuesday.html'; break;
case 'Wednesday': $page = 'wednesday.html'; break;
case 'Thursday': $page = 'thursday.html'; break;
case 'Friday': $page = 'friday.html'; break;
case 'Saturday': $page = 'saturday.html'; break;
}
echo file_get_contents($page);
?>
..then the php include code inside the .html would not work. Same with php echo, it would not display. Where might I be going wrong? My index.html (where onair.php works and is displayed on index.html) links to /programmes/schedule.html which then links to a respective page on a given day. There, the PHP code that is the same as in index.html does not display... It is simply commented in Google Chrome.
Any help would be appreciated. Cheers.
date('l')? Try echoing just try value.include strtolower(date('l')) . '.html';